summaryrefslogtreecommitdiffstats
path: root/tests/ui/lint/unused/issue-90807-unused-paren-error.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/lint/unused/issue-90807-unused-paren-error.rs')
-rw-r--r--tests/ui/lint/unused/issue-90807-unused-paren-error.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/ui/lint/unused/issue-90807-unused-paren-error.rs b/tests/ui/lint/unused/issue-90807-unused-paren-error.rs
new file mode 100644
index 000000000..2fca2e262
--- /dev/null
+++ b/tests/ui/lint/unused/issue-90807-unused-paren-error.rs
@@ -0,0 +1,9 @@
+// Make sure unused parens lint emit is emitted for loop and match.
+// See https://github.com/rust-lang/rust/issues/90807
+// and https://github.com/rust-lang/rust/pull/91956#discussion_r771647953
+#![deny(unused_parens)]
+
+fn main() {
+ for _ in (1..loop { break 2 }) {} //~ERROR
+ for _ in (1..match () { () => 2 }) {} //~ERROR
+}