-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsD-terseDiagnostics: An error or lint that doesn't give enough information about the problem at hand.Diagnostics: An error or lint that doesn't give enough information about the problem at hand.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
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
PatchMixolydic
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsD-terseDiagnostics: An error or lint that doesn't give enough information about the problem at hand.Diagnostics: An error or lint that doesn't give enough information about the problem at hand.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.