Closed
Description
#![allow(unreachable_code)]
#![deny(unused_braces)]
fn main() {
return { println!("!") };
}
$ rustc +nightly-2023-01-14 src/main.rs # correct behavior
error: unnecessary braces around `return` value
--> src/main.rs:5:12
|
5 | return { println!("!") };
| ^^ ^^
|
note: the lint level is defined here
--> src/main.rs:2:9
|
2 | #![deny(unused_braces)]
| ^^^^^^^^^^^^^
help: remove these braces
|
5 - return { println!("!") };
5 + return println!("!");
|
$ rustc +nightly-2023-01-15 src/main.rs # incorrect: no lint
The false negative bisects to #106866, so pretty obviously #106563. FYI @clubby789 @TaKO8Ki
From skimming #106545, that's an issue about const generics. It doesn't seem like the PR was supposed to have affected unused_braces situations outside of const generics position.