about summary refs log tree commit diff
path: root/src/tools/clippy/tests/ui/cast_raw_slice_pointer_cast.stderr
blob: 328dbafbafe7a11c85c4d04fc7a4fa8fcc2d69d8 (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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
error: casting the result of `from_raw_parts` to *const [u8]
  --> tests/ui/cast_raw_slice_pointer_cast.rs:9:35
   |
LL |     let _: *const [u8] = unsafe { std::slice::from_raw_parts(ptr, 1) as *const [u8] };
   |                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `std::ptr::slice_from_raw_parts(ptr, 1)`
   |
   = note: `-D clippy::cast-slice-from-raw-parts` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(clippy::cast_slice_from_raw_parts)]`

error: casting the result of `from_raw_parts_mut` to *mut [u8]
  --> tests/ui/cast_raw_slice_pointer_cast.rs:11:35
   |
LL |     let _: *const [u8] = unsafe { std::slice::from_raw_parts_mut(mptr, 1) as *mut [u8] };
   |                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `std::ptr::slice_from_raw_parts_mut(mptr, 1)`

error: casting the result of `from_raw_parts` to *const [u8]
  --> tests/ui/cast_raw_slice_pointer_cast.rs:13:26
   |
LL |     let _: *const [u8] = unsafe { std::slice::from_raw_parts(ptr, 1) } as *const [u8];
   |                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `std::ptr::slice_from_raw_parts(ptr, 1)`

error: casting the result of `from_raw_parts` to *const [u8]
  --> tests/ui/cast_raw_slice_pointer_cast.rs:17:30
   |
LL |         let _: *const [u8] = unsafe { slice::from_raw_parts(ptr, 1) } as *const [u8];
   |                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `std::ptr::slice_from_raw_parts(ptr, 1)`

error: casting the result of `from_raw_parts` to *const [u8]
  --> tests/ui/cast_raw_slice_pointer_cast.rs:20:30
   |
LL |         let _: *const [u8] = unsafe { one::from_raw_parts(ptr, 1) } as *const [u8];
   |                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `std::ptr::slice_from_raw_parts(ptr, 1)`

error: casting the result of `from_raw_parts` to *const [u8]
  --> tests/ui/cast_raw_slice_pointer_cast.rs:25:30
   |
LL |         let _: *const [u8] = unsafe { slice::from_raw_parts(ptr, 1) } as *const [u8];
   |                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `std::ptr::slice_from_raw_parts(ptr, 1)`

error: casting the result of `from_raw_parts` to *const [u8]
  --> tests/ui/cast_raw_slice_pointer_cast.rs:28:30
   |
LL |         let _: *const [u8] = unsafe { one::from_raw_parts(ptr, 1) } as *const [u8];
   |                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `std::ptr::slice_from_raw_parts(ptr, 1)`

error: implicitly casting the result of `from_raw_parts` to `*const [u8]`
  --> tests/ui/cast_raw_slice_pointer_cast.rs:34:39
   |
LL |         let _: *const [u8] = unsafe { std::slice::from_raw_parts(ptr, 1) };
   |                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace_with: `std::ptr::slice_from_raw_parts(ptr, 1)`

error: implicitly casting the result of `from_raw_parts_mut` to `*mut [u8]`
  --> tests/ui/cast_raw_slice_pointer_cast.rs:36:37
   |
LL |         let _: *mut [u8] = unsafe { std::slice::from_raw_parts_mut(mptr, 1) };
   |                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace_with: `std::ptr::slice_from_raw_parts_mut(mptr, 1)`

error: implicitly casting the result of `from_raw_parts` to `*const [u8]`
  --> tests/ui/cast_raw_slice_pointer_cast.rs:38:40
   |
LL |         require_raw_slice_ptr(unsafe { std::slice::from_raw_parts(ptr, 1) });
   |                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace_with: `std::ptr::slice_from_raw_parts(ptr, 1)`

error: implicitly casting the result of `from_raw_parts` to `*const [u8]`
  --> tests/ui/cast_raw_slice_pointer_cast.rs:46:39
   |
LL |         let _: *const [u8] = unsafe { std::slice::from_raw_parts(PTR, 1) };
   |                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace_with: `std::ptr::slice_from_raw_parts(PTR, 1)`

error: implicitly casting the result of `from_raw_parts_mut` to `*mut [u8]`
  --> tests/ui/cast_raw_slice_pointer_cast.rs:48:37
   |
LL |         let _: *mut [u8] = unsafe { std::slice::from_raw_parts_mut(MPTR, 1) };
   |                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace_with: `std::ptr::slice_from_raw_parts_mut(MPTR, 1)`

error: implicitly casting the result of `from_raw_parts` to `*const [u8]`
  --> tests/ui/cast_raw_slice_pointer_cast.rs:50:40
   |
LL |         require_raw_slice_ptr(unsafe { std::slice::from_raw_parts(PTR, 1) });
   |                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace_with: `std::ptr::slice_from_raw_parts(PTR, 1)`

error: aborting due to 13 previous errors