Closed
Description
Code
macro_rules! make_static {
($($v: vis)? $name: ident) => {
$($v)? static $name: u32 = 0;
};
}
Current output
error: repetition matches empty token tree
--> src/lib.rs:2:7
|
2 | ($($v: vis)? $name: ident) => {
| ^^^^^^^^^
Desired output
error: repetition matches empty token tree
--> src/lib.rs:2:7
|
2 | ($($v: vis)? $name: ident) => {
| ^^^^^^^^^
note: a `vis` fragment can already be empty
help: remove the `$(` and `)?`
Rationale and extra context
The current error is not very helpful and had be confused for quite some time.
@rustbot label D-terse
Other cases
Rust Version
1.88.0-nightly
(2025-04-06 2fa8b11f0933dae9b4e5)
Anything else?
No response