]> git.lizzy.rs Git - rust.git/blob - tests/ui/redundant_slicing.stderr
Split off new lint `deref_by_slicing` from `redundant_slicing`
[rust.git] / tests / ui / redundant_slicing.stderr
1 error: redundant slicing of the whole range
2   --> $DIR/redundant_slicing.rs:10:13
3    |
4 LL |     let _ = &slice[..]; // Redundant slice
5    |             ^^^^^^^^^^ help: use the original value instead: `slice`
6    |
7    = note: `-D clippy::redundant-slicing` implied by `-D warnings`
8
9 error: redundant slicing of the whole range
10   --> $DIR/redundant_slicing.rs:14:13
11    |
12 LL |     let _ = &(&*v)[..]; // Outer borrow is redundant
13    |             ^^^^^^^^^^ help: use the original value instead: `(&*v)`
14
15 error: redundant slicing of the whole range
16   --> $DIR/redundant_slicing.rs:17:20
17    |
18 LL |     let err = &mut &S[..]; // Should reborrow instead of slice
19    |                    ^^^^^^ help: reborrow the original value instead: `&*S`
20
21 error: redundant slicing of the whole range
22   --> $DIR/redundant_slicing.rs:21:13
23    |
24 LL |     let _ = &mut mut_slice[..]; // Should reborrow instead of slice
25    |             ^^^^^^^^^^^^^^^^^^ help: reborrow the original value instead: `&mut *mut_slice`
26
27 error: redundant slicing of the whole range
28   --> $DIR/redundant_slicing.rs:31:13
29    |
30 LL |     let _ = &m!(slice)[..];
31    |             ^^^^^^^^^^^^^^ help: use the original value instead: `slice`
32
33 error: redundant slicing of the whole range
34   --> $DIR/redundant_slicing.rs:41:13
35    |
36 LL |     let _ = &slice_ref[..]; // Deref instead of slice
37    |             ^^^^^^^^^^^^^^ help: dereference the original value instead: `*slice_ref`
38
39 error: redundant slicing of the whole range
40   --> $DIR/redundant_slicing.rs:45:13
41    |
42 LL |     let _ = (&bytes[..]).read_to_end(&mut vec![]).unwrap();
43    |             ^^^^^^^^^^^^ help: reborrow the original value instead: `(&*bytes)`
44
45 error: aborting due to 7 previous errors
46