rust/tests/ui/macros/issue-61033-2.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

26 lines
474 B
Rust
Raw Normal View History

2019-05-22 12:20:43 -05:00
// Regression test for issue #61033.
macro_rules! test2 {
(
$(* $id1:ident)*
$(+ $id2:ident)*
) => {
2020-03-17 06:12:57 -05:00
$(
//~^ ERROR meta-variable `id1` repeats 2 times
//~| ERROR meta-variable `id1` repeats 2 times
2019-05-22 12:20:43 -05:00
$id1 + $id2 // $id1 and $id2 may repeat different numbers of times
)*
}
}
fn main() {
test2! {
* a * b
+ a + b + c
}
2020-03-17 06:12:57 -05:00
test2! {
* a * b
+ a + b + c + d
}
2019-05-22 12:20:43 -05:00
}