about summary refs log tree commit diff
path: root/tests/ui/lint/lint-unnecessary-parens.fixed
diff options
context:
space:
mode:
authorGurinder Singh <frederick.the.fool@gmail.com>2023-10-30 19:04:55 +0530
committerGurinder Singh <frederick.the.fool@gmail.com>2023-10-30 19:04:55 +0530
commita2486dba3b6cd64b082273a3e24a3e8b6b65dc1b (patch)
tree4cbc673a1c6b7f49d1b9b3a74ecb261604846f8b /tests/ui/lint/lint-unnecessary-parens.fixed
parent91bbdd927a5e53a2fe126304fe8adbedf339616c (diff)
downloadrust-a2486dba3b6cd64b082273a3e24a3e8b6b65dc1b.tar.gz
rust-a2486dba3b6cd64b082273a3e24a3e8b6b65dc1b.zip
Fix missing leading space in suggestion
For a local pattern with no space between `let` and `(` e.g.:

  let(_a) = 3;

we were previously suggesting this illegal code:

  let_a =3;

After this change the suggestion will instead be:

  let _a =3;

(Note the space after `let`)
Diffstat (limited to 'tests/ui/lint/lint-unnecessary-parens.fixed')
-rw-r--r--tests/ui/lint/lint-unnecessary-parens.fixed8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/ui/lint/lint-unnecessary-parens.fixed b/tests/ui/lint/lint-unnecessary-parens.fixed
index bafac05d8da..b17914da6e6 100644
--- a/tests/ui/lint/lint-unnecessary-parens.fixed
+++ b/tests/ui/lint/lint-unnecessary-parens.fixed
@@ -84,6 +84,14 @@ fn main() {
     _a = 0; //~ ERROR unnecessary parentheses around assigned value
     _a += 1; //~ ERROR unnecessary parentheses around assigned value
 
+    let mut _a = 3; //~ ERROR unnecessary parentheses around pattern
+    let mut _a = 3; //~ ERROR unnecessary parentheses around pattern
+    let mut _a = 3; //~ ERROR unnecessary parentheses around pattern
+
+    let _a = 3; //~ ERROR unnecessary parentheses around pattern
+    let _a = 3; //~ ERROR unnecessary parentheses around pattern
+    let _a = 3; //~ ERROR unnecessary parentheses around pattern
+
     let _a = baz!(3, 4);
     let _b = baz!(3);
 }