summaryrefslogtreecommitdiffstats
path: root/src/test/ui/lint/issue-103435-extra-parentheses.fixed
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/lint/issue-103435-extra-parentheses.fixed')
-rw-r--r--src/test/ui/lint/issue-103435-extra-parentheses.fixed18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/test/ui/lint/issue-103435-extra-parentheses.fixed b/src/test/ui/lint/issue-103435-extra-parentheses.fixed
new file mode 100644
index 000000000..2b01b414b
--- /dev/null
+++ b/src/test/ui/lint/issue-103435-extra-parentheses.fixed
@@ -0,0 +1,18 @@
+// run-rustfix
+#![deny(unused_parens)]
+
+fn main() {
+ if let Some(_) = Some(1) {}
+ //~^ ERROR unnecessary parentheses around pattern
+
+ for _x in 1..10 {}
+ //~^ ERROR unnecessary parentheses around pattern
+
+ if 2 == 1 {}
+ //~^ ERROR unnecessary parentheses around `if` condition
+
+ // reported by parser
+ for _x in 1..10 {}
+ //~^ ERROR expected one of
+ //~| ERROR unexpected parentheses surrounding
+}