False unused_braces lint warning when using non-proc macro #73068
Labels
A-lint
Area: Lints (warnings about flaws in source code) such as unused_mut.
C-bug
Category: This is a bug.
L-unused_braces
Lint: unused_braces
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
I tried this code:
I expected to see this happen: No warnings, or applying hints from warnings improves the code.
Instead, this happened: The unused_braces lint fired, and applying the hint breaks the code.
The hint:
If the braces are removed:
Note: Adding a semicolon after the
println!()
(and leaving the braces) results in no warning and the code still compiles.I'm using stable, but reproduced on stable, debug, and nightly on play.rust-lang.org. The lint was added in #70081. I see #70717, but there are no explicit
ref
s here. And I also see #70814, but these are not proc macros.rustc --version --verbose
:The text was updated successfully, but these errors were encountered: