]> git.lizzy.rs Git - rust.git/blobdiff - tests/ui/needless_borrowed_ref.rs
Auto merge of #4478 - tsurai:master, r=flip1995
[rust.git] / tests / ui / needless_borrowed_ref.rs
index 3897c86f53a6eb1f18756e0814c9422718ca3895..c76f4de9b07ab444a29aec630b1e81f4c22fe10d 100644 (file)
@@ -1,12 +1,3 @@
-// Copyright 2014-2018 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
 #[warn(clippy::needless_borrowed_reference)]
 #[allow(unused_variables)]
 fn main() {
@@ -23,12 +14,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;
@@ -46,7 +37,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
     }
 }