about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorkennytm <kennytm@gmail.com>2018-10-30 18:55:25 +0800
committerGitHub <noreply@github.com>2018-10-30 18:55:25 +0800
commitdf511e94a04c3eaf7bf348ccfcbd4b22315bed84 (patch)
tree2302347377b3d9d51ef225a52cdf11759ce282ab /src/test
parentb1ca3907e00211b2f645133af3574ca22e4f4f4d (diff)
parent1a37575ade6dafedca29ffa03edbf2167cc1e544 (diff)
downloadrust-df511e94a04c3eaf7bf348ccfcbd4b22315bed84.tar.gz
rust-df511e94a04c3eaf7bf348ccfcbd4b22315bed84.zip
Rollup merge of #54885 - llogiq:fix-54704, r=nikomatsakis
Don't lint 'unused_parens` on `if (break _) { .. }`

This fixes #54704
Diffstat (limited to 'src/test')
-rw-r--r--src/test/ui/lint/unused_parens_json_suggestion.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/test/ui/lint/unused_parens_json_suggestion.rs b/src/test/ui/lint/unused_parens_json_suggestion.rs
index 187e7f31dfd..9eda59614f4 100644
--- a/src/test/ui/lint/unused_parens_json_suggestion.rs
+++ b/src/test/ui/lint/unused_parens_json_suggestion.rs
@@ -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
 }