mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-10 15:14:29 +00:00
0ff68bb151
Fix bad suggestion when a reborrow might be required Fix bad suggestion when the value being sliced is a macro call Don't lint inside of a macro due to the previous context sensitive changes
34 lines
1.2 KiB
Text
34 lines
1.2 KiB
Text
error: redundant slicing of the whole range
|
|
--> $DIR/redundant_slicing.rs:6:13
|
|
|
|
|
LL | let _ = &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:10: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:13: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:17: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 _ = &m!(slice)[..];
|
|
| ^^^^^^^^^^^^^^ help: use the original value instead: `slice`
|
|
|
|
error: aborting due to 5 previous errors
|
|
|