]> git.lizzy.rs Git - rust.git/blobdiff - tests/ui/needless_borrowed_ref.rs
Auto merge of #8374 - Alexendoo:bless-revisions, r=camsteffen
[rust.git] / tests / ui / needless_borrowed_ref.rs
index 4e9986561bc1b0ccf4cdf2d62b01516fdf35e2ff..500ac448f0d58c4da01ed449101803ba0d702f2f 100644 (file)
@@ -1,7 +1,6 @@
-#![feature(plugin)]
-#![plugin(clippy)]
+// run-rustfix
 
-#[warn(needless_borrowed_reference)]
+#[warn(clippy::needless_borrowed_reference)]
 #[allow(unused_variables)]
 fn main() {
     let mut v = Vec::<String>::new();
@@ -17,12 +16,12 @@ fn main() {
     let mut var2 = 5;
     let thingy2 = Some(&mut var2);
     if let Some(&mut ref mut v) = thingy2 {
-        //          ^ should *not* be linted
+        //          ^ should **not** be linted
         // v is borrowed as mutable.
         *v = 10;
     }
     if let Some(&mut ref v) = thingy2 {
-        //          ^ should *not* be linted
+        //          ^ should **not** be linted
         // here, v is borrowed as immutable.
         // can't do that:
         //*v = 15;
@@ -40,9 +39,7 @@ enum Animal {
 fn foo(a: &Animal, b: &Animal) {
     match (a, b) {
         (&Animal::Cat(v), &ref k) | (&ref k, &Animal::Cat(v)) => (), // lifetime mismatch error if there is no '&ref'
-        //                  ^    and   ^ should *not* be linted
-        (&Animal::Dog(ref a), &Animal::Dog(_)) => ()
-        //              ^ should *not* be linted
+        //                  ^    and   ^ should **not** be linted
+        (&Animal::Dog(ref a), &Animal::Dog(_)) => (), //              ^ should **not** be linted
     }
 }
-