about summary refs log tree commit diff
path: root/src/tools/clippy/tests/ui/unnecessary_struct_initialization.fixed
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools/clippy/tests/ui/unnecessary_struct_initialization.fixed')
-rw-r--r--src/tools/clippy/tests/ui/unnecessary_struct_initialization.fixed9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/tools/clippy/tests/ui/unnecessary_struct_initialization.fixed b/src/tools/clippy/tests/ui/unnecessary_struct_initialization.fixed
index b0e8f454635..07dc90acfa3 100644
--- a/src/tools/clippy/tests/ui/unnecessary_struct_initialization.fixed
+++ b/src/tools/clippy/tests/ui/unnecessary_struct_initialization.fixed
@@ -35,6 +35,7 @@ impl Clone for V {
     fn clone(&self) -> Self {
         // Lint: `Self` implements `Copy`
         *self
+        //~^ unnecessary_struct_initialization
     }
 }
 
@@ -42,9 +43,11 @@ fn main() {
     // Should lint: `a` would be consumed anyway
     let a = S { f: String::from("foo") };
     let mut b = a;
+    //~^ unnecessary_struct_initialization
 
     // Should lint: `b` would be consumed, and is mutable
     let c = &mut b;
+    //~^ unnecessary_struct_initialization
 
     // Should not lint as `d` is not mutable
     let d = S { f: String::from("foo") };
@@ -53,6 +56,7 @@ fn main() {
     // Should lint as `f` would be consumed anyway
     let f = S { f: String::from("foo") };
     let g = &f;
+    //~^ unnecessary_struct_initialization
 
     // Should lint: the result of an expression is mutable
     let h = &mut *Box::new(S { f: String::from("foo") });
@@ -77,6 +81,7 @@ fn main() {
     // Should lint: all fields of `q` would be consumed anyway
     let q = W { f1: 42, f2: 1337 };
     let r = q;
+    //~^ unnecessary_struct_initialization
 
     // Should not lint: not all fields of `t` from same source
     let s = W { f1: 1337, f2: 42 };
@@ -88,6 +93,7 @@ fn main() {
     // Should lint: all fields of `v` would be consumed anyway
     let v = W { f1: 42, f2: 1337 };
     let w = v;
+    //~^ unnecessary_struct_initialization
 
     // Should not lint: source differs between fields and base
     let x = W { f1: 42, f2: 1337 };
@@ -96,6 +102,7 @@ fn main() {
     // Should lint: range desugars to struct
     let r1 = 0..5;
     let r2 = r1;
+    //~^ unnecessary_struct_initialization
 
     references();
     shorthand();
@@ -109,6 +116,7 @@ fn references() {
     // Should lint as `d` is a shared reference
     let c = W { f1: 42, f2: 1337 };
     let d = &c;
+    //~^ unnecessary_struct_initialization
 
     // Should not lint as `e` is not mutable
     let e = W { f1: 42, f2: 1337 };
@@ -117,6 +125,7 @@ fn references() {
     // Should lint as `h` is a shared reference
     let g = W { f1: 42, f2: 1337 };
     let h = &g;
+    //~^ unnecessary_struct_initialization
 
     // Should not lint as `j` is copy
     let i = V { f: 0x1701d };