diff --git a/tests/ui/useless_attribute.rs b/tests/ui/useless_attribute.rs index 2b8a4cf56d7..0e30048163f 100644 --- a/tests/ui/useless_attribute.rs +++ b/tests/ui/useless_attribute.rs @@ -3,8 +3,6 @@ #![deny(useless_attribute)] #[allow(dead_code)] - - extern crate clippy_lints; // don't lint on unused_import for `use` items diff --git a/tests/ui/vec.rs b/tests/ui/vec.rs index 3717192fb98..f86137622b6 100644 --- a/tests/ui/vec.rs +++ b/tests/ui/vec.rs @@ -22,33 +22,18 @@ impl Line { fn main() { on_slice(&vec![]); - - - on_slice(&[]); on_slice(&vec![1, 2]); - - - on_slice(&[1, 2]); on_slice(&vec ![1, 2]); - - - on_slice(&[1, 2]); on_slice(&vec!(1, 2)); - - - on_slice(&[1, 2]); on_slice(&vec![1; 2]); - - - on_slice(&[1; 2]); on_vec(&vec![]); @@ -62,9 +47,6 @@ fn main() { on_slice(&vec![2; line.length()]); for a in vec![1, 2, 3] { - - - println!("{:?}", a); } diff --git a/tests/ui/vec.stderr b/tests/ui/vec.stderr index bffd30297d9..5243d882baa 100644 --- a/tests/ui/vec.stderr +++ b/tests/ui/vec.stderr @@ -10,34 +10,34 @@ note: lint level defined here 4 | #![deny(useless_vec)] | ^^^^^^^^^^^ +error: useless use of `vec!` + --> $DIR/vec.rs:27:14 + | +27 | on_slice(&vec![1, 2]); + | ^^^^^^^^^^^ help: you can use a slice directly `&[1, 2]` + error: useless use of `vec!` --> $DIR/vec.rs:30:14 | -30 | on_slice(&vec![1, 2]); +30 | on_slice(&vec ![1, 2]); + | ^^^^^^^^^^^^ help: you can use a slice directly `&[1, 2]` + +error: useless use of `vec!` + --> $DIR/vec.rs:33:14 + | +33 | on_slice(&vec!(1, 2)); | ^^^^^^^^^^^ help: you can use a slice directly `&[1, 2]` error: useless use of `vec!` --> $DIR/vec.rs:36:14 | -36 | on_slice(&vec ![1, 2]); - | ^^^^^^^^^^^^ help: you can use a slice directly `&[1, 2]` - -error: useless use of `vec!` - --> $DIR/vec.rs:42:14 - | -42 | on_slice(&vec!(1, 2)); - | ^^^^^^^^^^^ help: you can use a slice directly `&[1, 2]` - -error: useless use of `vec!` - --> $DIR/vec.rs:48:14 - | -48 | on_slice(&vec![1; 2]); +36 | on_slice(&vec![1; 2]); | ^^^^^^^^^^^ help: you can use a slice directly `&[1; 2]` error: useless use of `vec!` - --> $DIR/vec.rs:64:14 + --> $DIR/vec.rs:49:14 | -64 | for a in vec![1, 2, 3] { +49 | for a in vec![1, 2, 3] { | ^^^^^^^^^^^^^ help: you can use a slice directly `&[1, 2, 3]` error: aborting due to 6 previous errors