2022-01-11 11:41:15 -06:00
|
|
|
error: slicing when dereferencing would work
|
2023-07-27 06:40:22 -05:00
|
|
|
--> $DIR/deref_by_slicing.rs:8:13
|
2022-01-11 11:41:15 -06:00
|
|
|
|
|
|
|
|
LL | let _ = &vec[..];
|
|
|
|
| ^^^^^^^^ help: dereference the original value instead: `&*vec`
|
|
|
|
|
|
|
|
|
= note: `-D clippy::deref-by-slicing` implied by `-D warnings`
|
|
|
|
|
|
|
|
error: slicing when dereferencing would work
|
2023-07-27 06:40:22 -05:00
|
|
|
--> $DIR/deref_by_slicing.rs:9:13
|
2022-01-11 11:41:15 -06:00
|
|
|
|
|
|
|
|
LL | let _ = &mut vec[..];
|
|
|
|
| ^^^^^^^^^^^^ help: dereference the original value instead: `&mut *vec`
|
|
|
|
|
|
|
|
error: slicing when dereferencing would work
|
2023-07-27 06:40:22 -05:00
|
|
|
--> $DIR/deref_by_slicing.rs:12:13
|
2022-01-11 11:41:15 -06:00
|
|
|
|
|
|
|
|
LL | let _ = &ref_vec[..];
|
|
|
|
| ^^^^^^^^^^^^ help: dereference the original value instead: `&**ref_vec`
|
|
|
|
|
|
|
|
error: slicing when dereferencing would work
|
2023-07-27 06:40:22 -05:00
|
|
|
--> $DIR/deref_by_slicing.rs:13:21
|
2022-01-11 11:41:15 -06:00
|
|
|
|
|
2022-02-13 17:43:19 -06:00
|
|
|
LL | let mut_slice = &mut ref_vec[..];
|
|
|
|
| ^^^^^^^^^^^^^^^^ help: dereference the original value instead: `&mut **ref_vec`
|
2022-01-11 11:41:15 -06:00
|
|
|
|
|
|
|
error: slicing when dereferencing would work
|
2023-07-27 06:40:22 -05:00
|
|
|
--> $DIR/deref_by_slicing.rs:14:13
|
2022-01-11 11:41:15 -06:00
|
|
|
|
|
2022-02-13 17:43:19 -06:00
|
|
|
LL | let _ = &mut mut_slice[..]; // Err, re-borrows slice
|
|
|
|
| ^^^^^^^^^^^^^^^^^^ help: reborrow the original value instead: `&mut *mut_slice`
|
|
|
|
|
|
|
|
error: slicing when dereferencing would work
|
2023-07-27 06:40:22 -05:00
|
|
|
--> $DIR/deref_by_slicing.rs:17:13
|
2022-02-13 17:43:19 -06:00
|
|
|
|
|
2022-01-11 11:41:15 -06:00
|
|
|
LL | let _ = &s[..];
|
|
|
|
| ^^^^^^ help: dereference the original value instead: `&*s`
|
|
|
|
|
2022-02-13 17:43:19 -06:00
|
|
|
error: slicing when dereferencing would work
|
2023-07-27 06:40:22 -05:00
|
|
|
--> $DIR/deref_by_slicing.rs:20:18
|
2022-02-13 17:43:19 -06:00
|
|
|
|
|
|
|
|
LL | let _ = &mut &S[..]; // Err, re-borrows slice
|
|
|
|
| ^^^^^^ help: reborrow the original value instead: `&*S`
|
|
|
|
|
|
|
|
error: slicing when dereferencing would work
|
2023-07-27 06:40:22 -05:00
|
|
|
--> $DIR/deref_by_slicing.rs:24:13
|
2022-02-13 17:43:19 -06:00
|
|
|
|
|
|
|
|
LL | let _ = &slice_ref[..]; // Err, derefs slice
|
|
|
|
| ^^^^^^^^^^^^^^ help: dereference the original value instead: `*slice_ref`
|
|
|
|
|
|
|
|
error: slicing when dereferencing would work
|
2023-07-27 06:40:22 -05:00
|
|
|
--> $DIR/deref_by_slicing.rs:27:13
|
2022-02-13 17:43:19 -06:00
|
|
|
|
|
|
|
|
LL | let _ = (&bytes[..]).read_to_end(&mut vec![]).unwrap(); // Err, re-borrows slice
|
|
|
|
| ^^^^^^^^^^^^ help: reborrow the original value instead: `(&*bytes)`
|
|
|
|
|
|
|
|
error: aborting due to 9 previous errors
|
2022-01-11 11:41:15 -06:00
|
|
|
|