Skip to content

Commit 28a0974

Browse files
committed
tests: add test for check correct macro hygiene
1 parent 5b70186 commit 28a0974

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

tests/macro-hygiene.rs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
macro_rules! wrap_init {
2+
($($args:tt)*) => {
3+
::pin_init::init!(
4+
$($args)*
5+
)
6+
}
7+
}
8+
9+
struct Foo {
10+
a: u32,
11+
b: u32,
12+
c: u32,
13+
}
14+
15+
fn main() {
16+
let c = 3;
17+
let _ = wrap_init!(Foo {
18+
a: 1,
19+
b <- 2,
20+
c,
21+
});
22+
}

0 commit comments

Comments
 (0)