Rollup merge of #54885 - llogiq:fix-54704, r=nikomatsakis

Don't lint 'unused_parens` on `if (break _) { .. }`

This fixes #54704
This commit is contained in:
kennytm 2018-10-30 18:55:25 +08:00 committed by GitHub
commit df511e94a0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 4 deletions

View file

@ -23,4 +23,13 @@ fn main() {
// We want to suggest the properly-balanced expression `1 / (2 + 3)`, not
// the malformed `1 / (2 + 3`
let _a = (1 / (2 + 3));
f();
}
fn f() -> bool {
loop {
if (break { return true }) {
}
}
false
}