Misleading unnecessary braces warning #104141
Labels
A-const-generics
Area: const generics (parameters and arguments)
A-diagnostics
Area: Messages for errors, warnings, and lints
A-macros
Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..)
C-bug
Category: This is a bug.
D-incorrect
Diagnostics: A diagnostic that is giving misleading or incorrect information.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Const generics, combined with the
cfg!
macro gives an "unnecessary braces" warning. However, removing the braces results in a compilation failure.Example:
https://rust.godbolt.org/z/Kv8Eq5hzn
I expect no warning to be emitted for the following code:
The text was updated successfully, but these errors were encountered: