about summary refs log tree commit diff
path: root/src/tools/clippy/tests/ui/unneeded_struct_pattern.fixed
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools/clippy/tests/ui/unneeded_struct_pattern.fixed')
-rw-r--r--src/tools/clippy/tests/ui/unneeded_struct_pattern.fixed55
1 files changed, 34 insertions, 21 deletions
diff --git a/src/tools/clippy/tests/ui/unneeded_struct_pattern.fixed b/src/tools/clippy/tests/ui/unneeded_struct_pattern.fixed
index 5bd269896a6..665ab98913b 100644
--- a/src/tools/clippy/tests/ui/unneeded_struct_pattern.fixed
+++ b/src/tools/clippy/tests/ui/unneeded_struct_pattern.fixed
@@ -15,11 +15,13 @@ fn main() {
     match Some(114514) {
         Some(v) => v,
         None => 0,
+        //~^ unneeded_struct_pattern
     };
 
     match Some(1919810) {
         Some(v) => v,
         None => 0,
+        //~^ unneeded_struct_pattern
     };
 
     match Some(123456) {
@@ -30,15 +32,23 @@ fn main() {
     match Some(Some(123456)) {
         Some(Some(v)) => v,
         Some(None) => 0,
+        //~^ unneeded_struct_pattern
         None => 0,
+        //~^ unneeded_struct_pattern
     };
 
     if let None = Some(0) {}
+    //~^ unneeded_struct_pattern
     if let None = Some(0) {}
+    //~^ unneeded_struct_pattern
     if let Some(None) = Some(Some(0)) {}
+    //~^ unneeded_struct_pattern
     let None = Some(0) else { panic!() };
+    //~^ unneeded_struct_pattern
     let None = Some(0) else { panic!() };
+    //~^ unneeded_struct_pattern
     let Some(None) = Some(Some(0)) else { panic!() };
+    //~^ unneeded_struct_pattern
 
     enum Custom {
         HasFields {
@@ -54,26 +64,28 @@ fn main() {
     match Custom::Init {
         Custom::HasFields { field: value } => value,
         Custom::HasBracketsNoFields {} => 0,
-        Custom::NoBrackets => 0, //~ ERROR: struct pattern is not needed for a unit variant
-        Custom::NoBracketsNonExhaustive => 0, //~ ERROR: struct pattern is not needed for a unit variant
+        Custom::NoBrackets => 0,              //~ unneeded_struct_pattern
+        Custom::NoBracketsNonExhaustive => 0, //~ unneeded_struct_pattern
         _ => 0,
     };
 
     match Custom::Init {
         Custom::HasFields { field: value } => value,
         Custom::HasBracketsNoFields { .. } => 0,
-        Custom::NoBrackets => 0, //~ ERROR: struct pattern is not needed for a unit variant
-        Custom::NoBracketsNonExhaustive => 0, //~ ERROR: struct pattern is not needed for a unit variant
+        Custom::NoBrackets => 0,              //~ unneeded_struct_pattern
+        Custom::NoBracketsNonExhaustive => 0, //~ unneeded_struct_pattern
         _ => 0,
     };
 
     match Custom::Init {
-        Custom::NoBrackets if true => 0, //~ ERROR: struct pattern is not needed for a unit variant
+        Custom::NoBrackets if true => 0, //~ unneeded_struct_pattern
         _ => 0,
     };
 
     match Custom::Init {
-        Custom::NoBrackets | Custom::NoBracketsNonExhaustive => 0, //~ ERROR: struct pattern is not needed for a unit variant
+        Custom::NoBrackets | Custom::NoBracketsNonExhaustive => 0,
+        //~^ unneeded_struct_pattern
+        //~| unneeded_struct_pattern
         _ => 0,
     };
 
@@ -87,23 +99,24 @@ fn main() {
         noop();
     }
     if let Custom::NoBrackets = Custom::Init {
-        //~^ ERROR: struct pattern is not needed for a unit variant
+        //~^ unneeded_struct_pattern
         noop();
     }
     if let Custom::NoBrackets = Custom::Init {
-        //~^ ERROR: struct pattern is not needed for a unit variant
+        //~^ unneeded_struct_pattern
         noop();
     }
     if let Custom::NoBrackets | Custom::NoBracketsNonExhaustive = Custom::Init {
-        //~^ ERROR: struct pattern is not needed for a unit variant
+        //~^ unneeded_struct_pattern
+        //~| unneeded_struct_pattern
         noop();
     }
     if let Custom::NoBracketsNonExhaustive = Custom::Init {
-        //~^ ERROR: struct pattern is not needed for a unit variant
+        //~^ unneeded_struct_pattern
         noop();
     }
     if let Custom::NoBracketsNonExhaustive = Custom::Init {
-        //~^ ERROR: struct pattern is not needed for a unit variant
+        //~^ unneeded_struct_pattern
         noop();
     }
 
@@ -118,18 +131,18 @@ fn main() {
     let Custom::HasBracketsNoFields { .. } = Custom::Init else {
         panic!()
     };
-    let Custom::NoBrackets = Custom::Init else { panic!() }; //~ ERROR: struct pattern is not needed for a unit variant
+    let Custom::NoBrackets = Custom::Init else { panic!() }; //~ unneeded_struct_pattern
 
     let Custom::NoBrackets = Custom::Init else {
-        //~^ ERROR: struct pattern is not needed for a unit variant
+        //~^ unneeded_struct_pattern
         panic!()
     };
     let Custom::NoBracketsNonExhaustive = Custom::Init else {
-        //~^ ERROR: struct pattern is not needed for a unit variant
+        //~^ unneeded_struct_pattern
         panic!()
     };
     let Custom::NoBracketsNonExhaustive = Custom::Init else {
-        //~^ ERROR: struct pattern is not needed for a unit variant
+        //~^ unneeded_struct_pattern
         panic!()
     };
 
@@ -137,11 +150,11 @@ fn main() {
         Variant,
     }
 
-    fn pat_in_fn_param_1(Refutable::Variant: Refutable) {} //~ ERROR: struct pattern is not needed for a unit variant
-    fn pat_in_fn_param_2(Refutable::Variant: Refutable) {} //~ ERROR: struct pattern is not needed for a unit variant
+    fn pat_in_fn_param_1(Refutable::Variant: Refutable) {} //~ unneeded_struct_pattern
+    fn pat_in_fn_param_2(Refutable::Variant: Refutable) {} //~ unneeded_struct_pattern
 
-    for Refutable::Variant in [] {} //~ ERROR: struct pattern is not needed for a unit variant
-    for Refutable::Variant in [] {} //~ ERROR: struct pattern is not needed for a unit variant
+    for Refutable::Variant in [] {} //~ unneeded_struct_pattern
+    for Refutable::Variant in [] {} //~ unneeded_struct_pattern
 }
 
 fn external_crate() {
@@ -155,13 +168,13 @@ fn external_crate() {
 
     match ExhaustiveUnit {
         // Exhaustive variant
-        ExhaustiveUnit => 0, //~ ERROR: struct pattern is not needed for a unit variant
+        ExhaustiveUnit => 0, //~ unneeded_struct_pattern
         _ => 0,
     };
 
     match ExhaustiveUnit {
         // Exhaustive variant
-        ExhaustiveUnit => 0, //~ ERROR: struct pattern is not needed for a unit variant
+        ExhaustiveUnit => 0, //~ unneeded_struct_pattern
         _ => 0,
     };