]> git.lizzy.rs Git - rust.git/blobdiff - tests/ui/drop_forget_copy.rs
Auto merge of #6336 - giraffate:sync-from-rust, r=flip1995
[rust.git] / tests / ui / drop_forget_copy.rs
index 4e48a89b65988f467a35431d902f5c947da24f4e..9ddd6d64701a61dd615ec0b1d1f5d5451601617f 100644 (file)
@@ -1,25 +1,25 @@
-#![feature(plugin)]
-#![plugin(clippy)]
-
-#![warn(drop_copy, forget_copy)]
-#![allow(toplevel_ref_arg, drop_ref, forget_ref, unused_mut)]
+#![warn(clippy::drop_copy, clippy::forget_copy)]
+#![allow(clippy::toplevel_ref_arg, clippy::drop_ref, clippy::forget_ref, unused_mut)]
 
 use std::mem::{drop, forget};
 use std::vec::Vec;
 
 #[derive(Copy, Clone)]
-struct SomeStruct {
-}
+struct SomeStruct {}
 
 struct AnotherStruct {
     x: u8,
     y: u8,
-    z: Vec<u8>
+    z: Vec<u8>,
 }
 
 impl Clone for AnotherStruct {
-    fn clone(& self) -> AnotherStruct {
-        AnotherStruct{x: self.x, y: self.y, z: self.z.clone()}
+    fn clone(&self) -> AnotherStruct {
+        AnotherStruct {
+            x: self.x,
+            y: self.y,
+            z: self.z.clone(),
+        }
     }
 }
 
@@ -42,7 +42,11 @@ fn main() {
     forget(s4);
     forget(s5);
 
-    let a1 = AnotherStruct {x: 255, y: 0, z: vec![1, 2, 3]};
+    let a1 = AnotherStruct {
+        x: 255,
+        y: 0,
+        z: vec![1, 2, 3],
+    };
     let a2 = &a1;
     let mut a3 = a1.clone();
     let ref a4 = a1;