Code
macro_rules! repro {
($($e:$expr),*) => {}
}
(note the extraneous `$` in `$e:$expr`)
Current output
error: missing fragment specifier
--> src/lib.rs:2:11
|
2 | ($($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: try adding a specifier here
|
2 | ($($e:$:specexpr),*) => {}
| +++++
Desired output
Rationale and extra context
Ideally I would like the diagnostic to point out the $ as extraneous and simply suggest its removal. Or at the very least, produce something that is syntactically correct Rust. even if it's not the code the user "meant" to write.
Other cases
Rust Version
play.rust-lang.org, stable (1.96.0)
Anything else?
No response
Code
Current output
Desired output
Rationale and extra context
Ideally I would like the diagnostic to point out the
$as extraneous and simply suggest its removal. Or at the very least, produce something that is syntactically correct Rust. even if it's not the code the user "meant" to write.Other cases
Rust Version
Anything else?
No response