diff --git a/tests/ui/macros/macro-missing-fragment.rs b/tests/ui/macros/macro-missing-fragment.rs index 827c7fc319272..e9cfc07e3363c 100644 --- a/tests/ui/macros/macro-missing-fragment.rs +++ b/tests/ui/macros/macro-missing-fragment.rs @@ -17,6 +17,10 @@ macro_rules! accidental_dollar_prefix { ( $test:$tt ) => {}; //~ ERROR missing fragment } +macro_rules! accidental_dollar_prefix_in_repetition { + ( $($test:$tt),* ) => {}; //~ ERROR missing fragment +} + fn main() { used_arm!(); used_macro_unused_arm!(); diff --git a/tests/ui/macros/macro-missing-fragment.stderr b/tests/ui/macros/macro-missing-fragment.stderr index b1b9bf3d8aa97..b705544df1665 100644 --- a/tests/ui/macros/macro-missing-fragment.stderr +++ b/tests/ui/macros/macro-missing-fragment.stderr @@ -51,5 +51,19 @@ LL - ( $test:$tt ) => {}; LL + ( $test:tt ) => {}; | -error: aborting due to 4 previous errors +error: missing fragment specifier + --> $DIR/macro-missing-fragment.rs:21:15 + | +LL | ( $($test:$tt),* ) => {}; + | ^ + | + = note: fragment specifiers must be provided + = help: valid fragment specifiers are `ident`, `block`, `stmt`, `expr`, `pat`, `ty`, `lifetime`, `literal`, `path`, `meta`, `tt`, `item` and `vis`, along with `expr_2021` and `pat_param` for edition compatibility +help: fragment specifiers should not be prefixed with `$` + | +LL - ( $($test:$tt),* ) => {}; +LL + ( $($test:tt),* ) => {}; + | + +error: aborting due to 5 previous errors