mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-14 17:07:17 +00:00
64 lines
2.4 KiB
Text
64 lines
2.4 KiB
Text
error: redundant slicing of the whole range
|
|
--> $DIR/redundant_slicing.rs:10:13
|
|
|
|
|
LL | let _ = &slice[..]; // Redundant slice
|
|
| ^^^^^^^^^^ help: use the original value instead: `slice`
|
|
|
|
|
= note: `-D clippy::redundant-slicing` implied by `-D warnings`
|
|
|
|
error: redundant slicing of the whole range
|
|
--> $DIR/redundant_slicing.rs:13:13
|
|
|
|
|
LL | let _ = &v[..]; // Deref instead of slice
|
|
| ^^^^^^ help: dereference the original value instead: `&*v`
|
|
|
|
error: redundant slicing of the whole range
|
|
--> $DIR/redundant_slicing.rs:14:13
|
|
|
|
|
LL | let _ = &(&*v)[..]; // Outer borrow is redundant
|
|
| ^^^^^^^^^^ help: use the original value instead: `(&*v)`
|
|
|
|
error: redundant slicing of the whole range
|
|
--> $DIR/redundant_slicing.rs:17:20
|
|
|
|
|
LL | let err = &mut &S[..]; // Should reborrow instead of slice
|
|
| ^^^^^^ help: reborrow the original value instead: `&*S`
|
|
|
|
error: redundant slicing of the whole range
|
|
--> $DIR/redundant_slicing.rs:20:21
|
|
|
|
|
LL | let mut_slice = &mut vec[..]; // Deref instead of slice
|
|
| ^^^^^^^^^^^^ help: dereference the original value instead: `&mut *vec`
|
|
|
|
error: redundant slicing of the whole range
|
|
--> $DIR/redundant_slicing.rs:21:13
|
|
|
|
|
LL | let _ = &mut mut_slice[..]; // Should reborrow instead of slice
|
|
| ^^^^^^^^^^^^^^^^^^ help: reborrow the original value instead: `&mut *mut_slice`
|
|
|
|
error: redundant slicing of the whole range
|
|
--> $DIR/redundant_slicing.rs:24:13
|
|
|
|
|
LL | let _ = &ref_vec[..]; // Deref instead of slice
|
|
| ^^^^^^^^^^^^ help: dereference the original value instead: `&**ref_vec`
|
|
|
|
error: redundant slicing of the whole range
|
|
--> $DIR/redundant_slicing.rs:31:13
|
|
|
|
|
LL | let _ = &m!(slice)[..];
|
|
| ^^^^^^^^^^^^^^ help: use the original value instead: `slice`
|
|
|
|
error: redundant slicing of the whole range
|
|
--> $DIR/redundant_slicing.rs:41:13
|
|
|
|
|
LL | let _ = &slice_ref[..]; // Deref instead of slice
|
|
| ^^^^^^^^^^^^^^ help: dereference the original value instead: `*slice_ref`
|
|
|
|
error: redundant slicing of the whole range
|
|
--> $DIR/redundant_slicing.rs:45:13
|
|
|
|
|
LL | let _ = (&bytes[..]).read_to_end(&mut vec![]).unwrap();
|
|
| ^^^^^^^^^^^^ help: reborrow the original value instead: `(&*bytes)`
|
|
|
|
error: aborting due to 10 previous errors
|
|
|