mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-27 23:20:39 +00:00
40 lines
1.1 KiB
Text
40 lines
1.1 KiB
Text
error: useless use of `vec!`
|
|
--> $DIR/vec.rs:34:14
|
|
|
|
|
34 | on_slice(&vec![]);
|
|
| ^^^^^^^ help: you can use a slice directly: `&[]`
|
|
|
|
|
= note: `-D clippy::useless-vec` implied by `-D warnings`
|
|
|
|
error: useless use of `vec!`
|
|
--> $DIR/vec.rs:37:14
|
|
|
|
|
37 | on_slice(&vec![1, 2]);
|
|
| ^^^^^^^^^^^ help: you can use a slice directly: `&[1, 2]`
|
|
|
|
error: useless use of `vec!`
|
|
--> $DIR/vec.rs:40:14
|
|
|
|
|
40 | on_slice(&vec ![1, 2]);
|
|
| ^^^^^^^^^^^^ help: you can use a slice directly: `&[1, 2]`
|
|
|
|
error: useless use of `vec!`
|
|
--> $DIR/vec.rs:43:14
|
|
|
|
|
43 | on_slice(&vec!(1, 2));
|
|
| ^^^^^^^^^^^ help: you can use a slice directly: `&[1, 2]`
|
|
|
|
error: useless use of `vec!`
|
|
--> $DIR/vec.rs:46:14
|
|
|
|
|
46 | on_slice(&vec![1; 2]);
|
|
| ^^^^^^^^^^^ help: you can use a slice directly: `&[1; 2]`
|
|
|
|
error: useless use of `vec!`
|
|
--> $DIR/vec.rs:59:14
|
|
|
|
|
59 | for a in vec![1, 2, 3] {
|
|
| ^^^^^^^^^^^^^ help: you can use a slice directly: `&[1, 2, 3]`
|
|
|
|
error: aborting due to 6 previous errors
|
|
|