-
-
Notifications
You must be signed in to change notification settings - Fork 15k
False positive unused_braces when calling a macro #106545
Copy link
Copy link
Closed
Labels
A-const-genericsArea: const generics (parameters and arguments)Area: const generics (parameters and arguments)A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.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.
Metadata
Metadata
Assignees
Labels
A-const-genericsArea: const generics (parameters and arguments)Area: const generics (parameters and arguments)A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.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.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Playground: https://play.rust-lang.org/?version=nightly&mode=debug&edition=2021&gist=058b224b06eefb23132dda5fad6f2950
The above generates a warning:
That above warning is either
rustcfunctionality or error, because without the braces it produces a (confusing) error. The same example code adjusted:Limited playground (I don't see a way to pass
-Z macro-backtraceto the playground):https://play.rust-lang.org/?version=nightly&mode=debug&edition=2021&gist=8b334f459ac48f56639de94f116a7705
The current output (with
nightlyinvoked withRUSTFLAGS="-Z macro-backtrace" cargo build) is:Thank you in advance for any progress.