Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions tests/ui/macros/macro-missing-fragment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ macro_rules! accidental_dollar_prefix {
( $test:$tt ) => {}; //~ ERROR missing fragment
}

macro_rules! accidental_dollar_prefix_in_repetition {
( $($e:$expr),* ) => {}; //~ ERROR missing fragment
}

fn main() {
used_arm!();
used_macro_unused_arm!();
Expand Down
16 changes: 15 additions & 1 deletion tests/ui/macros/macro-missing-fragment.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -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:12
|
LL | ( $($e:$expr),* ) => {};
| ^
|
= 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 - ( $($e:$expr),* ) => {};
LL + ( $($e:expr),* ) => {};
|

error: aborting due to 5 previous errors

Loading