Code
#[allow(unused)]
macro_rules! demo {
( $test:$tt ) => {
}
}
Current output
Compiling playground v0.0.1 (/playground)
error: missing fragment specifier
--> src/lib.rs:3:13
|
3 | ( $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: try adding a specifier here
|
3 | ( $test:$:spectt ) => {
| +++++
error: could not compile `playground` (lib) due to 1 previous error
Desired output
Compiling playground v0.0.1 (/playground)
error: missing fragment specifier
--> src/lib.rs:3:13
|
3 | ( $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 $
|
3 | ( $test:tt ) => {
| -
error: could not compile `playground` (lib) due to 1 previous error
Rationale and extra context
I accidentally wrote $test:$tt instead of $test:tt and the suggestion was to add :spec in the wrong place, but even if the place was fixed given that I was trying to add the fragment specifier the error message should adjust for that
Other cases
Rust Version
Stable 1.95.0 via playground
Anything else?
No response
Code
Current output
Desired output
Rationale and extra context
I accidentally wrote
$test:$ttinstead of$test:ttand the suggestion was to add:specin the wrong place, but even if the place was fixed given that I was trying to add the fragment specifier the error message should adjust for thatOther cases
Rust Version
Anything else?
No response