about summary refs log tree commit diff
path: root/src/tools/clippy/tests/ui/deref_by_slicing.stderr
blob: 4a379a83dfa7a6e0735d9e8d2837bf5675752ff3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
error: slicing when dereferencing would work
  --> tests/ui/deref_by_slicing.rs:8:13
   |
LL |     let _ = &vec[..];
   |             ^^^^^^^^ help: dereference the original value instead: `&*vec`
   |
   = note: `-D clippy::deref-by-slicing` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(clippy::deref_by_slicing)]`

error: slicing when dereferencing would work
  --> tests/ui/deref_by_slicing.rs:10:13
   |
LL |     let _ = &mut vec[..];
   |             ^^^^^^^^^^^^ help: dereference the original value instead: `&mut *vec`

error: slicing when dereferencing would work
  --> tests/ui/deref_by_slicing.rs:14:13
   |
LL |     let _ = &ref_vec[..];
   |             ^^^^^^^^^^^^ help: dereference the original value instead: `&**ref_vec`

error: slicing when dereferencing would work
  --> tests/ui/deref_by_slicing.rs:16:21
   |
LL |     let mut_slice = &mut ref_vec[..];
   |                     ^^^^^^^^^^^^^^^^ help: dereference the original value instead: `&mut **ref_vec`

error: slicing when dereferencing would work
  --> tests/ui/deref_by_slicing.rs:18:13
   |
LL |     let _ = &mut mut_slice[..]; // Err, re-borrows slice
   |             ^^^^^^^^^^^^^^^^^^ help: reborrow the original value instead: `&mut *mut_slice`

error: slicing when dereferencing would work
  --> tests/ui/deref_by_slicing.rs:23:13
   |
LL |     let _ = &s[..];
   |             ^^^^^^ help: dereference the original value instead: `&*s`

error: slicing when dereferencing would work
  --> tests/ui/deref_by_slicing.rs:27:18
   |
LL |     let _ = &mut &S[..]; // Err, re-borrows slice
   |                  ^^^^^^ help: reborrow the original value instead: `&*S`

error: slicing when dereferencing would work
  --> tests/ui/deref_by_slicing.rs:33:13
   |
LL |     let _ = &slice_ref[..]; // Err, derefs slice
   |             ^^^^^^^^^^^^^^ help: dereference the original value instead: `*slice_ref`

error: slicing when dereferencing would work
  --> tests/ui/deref_by_slicing.rs:38:13
   |
LL |     let _ = (&bytes[..]).read_to_end(&mut vec![]).unwrap(); // Err, re-borrows slice
   |             ^^^^^^^^^^^^ help: reborrow the original value instead: `(&*bytes)`

error: slicing when dereferencing would work
  --> tests/ui/deref_by_slicing.rs:44:13
   |
LL |     let _ = &a[..];
   |             ^^^^^^ help: reborrow the original value instead: `&*a`

error: aborting due to 10 previous errors