|
1 | 1 | error: casting the result of `from_raw_parts` to *const [u8]
|
2 |
| - --> tests/ui/cast_raw_slice_pointer_cast.rs:8:35 |
| 2 | + --> tests/ui/cast_raw_slice_pointer_cast.rs:9:35 |
3 | 3 | |
|
4 | 4 | LL | let _: *const [u8] = unsafe { std::slice::from_raw_parts(ptr, 1) as *const [u8] };
|
5 |
| - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `core::ptr::slice_from_raw_parts(ptr, 1)` |
| 5 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `std::ptr::slice_from_raw_parts(ptr, 1)` |
6 | 6 | |
|
7 | 7 | = note: `-D clippy::cast-slice-from-raw-parts` implied by `-D warnings`
|
8 | 8 | = help: to override `-D warnings` add `#[allow(clippy::cast_slice_from_raw_parts)]`
|
9 | 9 |
|
10 | 10 | error: casting the result of `from_raw_parts_mut` to *mut [u8]
|
11 |
| - --> tests/ui/cast_raw_slice_pointer_cast.rs:10:35 |
| 11 | + --> tests/ui/cast_raw_slice_pointer_cast.rs:11:35 |
12 | 12 | |
|
13 | 13 | LL | let _: *const [u8] = unsafe { std::slice::from_raw_parts_mut(mptr, 1) as *mut [u8] };
|
14 |
| - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `core::ptr::slice_from_raw_parts_mut(mptr, 1)` |
| 14 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `std::ptr::slice_from_raw_parts_mut(mptr, 1)` |
15 | 15 |
|
16 | 16 | error: casting the result of `from_raw_parts` to *const [u8]
|
17 |
| - --> tests/ui/cast_raw_slice_pointer_cast.rs:12:26 |
| 17 | + --> tests/ui/cast_raw_slice_pointer_cast.rs:13:26 |
18 | 18 | |
|
19 | 19 | LL | let _: *const [u8] = unsafe { std::slice::from_raw_parts(ptr, 1) } as *const [u8];
|
20 |
| - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `core::ptr::slice_from_raw_parts(ptr, 1)` |
| 20 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `std::ptr::slice_from_raw_parts(ptr, 1)` |
21 | 21 |
|
22 | 22 | error: casting the result of `from_raw_parts` to *const [u8]
|
23 |
| - --> tests/ui/cast_raw_slice_pointer_cast.rs:16:30 |
| 23 | + --> tests/ui/cast_raw_slice_pointer_cast.rs:17:30 |
24 | 24 | |
|
25 | 25 | LL | let _: *const [u8] = unsafe { slice::from_raw_parts(ptr, 1) } as *const [u8];
|
26 |
| - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `core::ptr::slice_from_raw_parts(ptr, 1)` |
| 26 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `std::ptr::slice_from_raw_parts(ptr, 1)` |
27 | 27 |
|
28 | 28 | error: casting the result of `from_raw_parts` to *const [u8]
|
29 |
| - --> tests/ui/cast_raw_slice_pointer_cast.rs:19:30 |
| 29 | + --> tests/ui/cast_raw_slice_pointer_cast.rs:20:30 |
30 | 30 | |
|
31 | 31 | LL | let _: *const [u8] = unsafe { one::from_raw_parts(ptr, 1) } as *const [u8];
|
32 |
| - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `core::ptr::slice_from_raw_parts(ptr, 1)` |
| 32 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `std::ptr::slice_from_raw_parts(ptr, 1)` |
33 | 33 |
|
34 | 34 | error: casting the result of `from_raw_parts` to *const [u8]
|
35 |
| - --> tests/ui/cast_raw_slice_pointer_cast.rs:24:30 |
| 35 | + --> tests/ui/cast_raw_slice_pointer_cast.rs:25:30 |
36 | 36 | |
|
37 | 37 | LL | let _: *const [u8] = unsafe { slice::from_raw_parts(ptr, 1) } as *const [u8];
|
38 |
| - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `core::ptr::slice_from_raw_parts(ptr, 1)` |
| 38 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `std::ptr::slice_from_raw_parts(ptr, 1)` |
39 | 39 |
|
40 | 40 | error: casting the result of `from_raw_parts` to *const [u8]
|
41 |
| - --> tests/ui/cast_raw_slice_pointer_cast.rs:27:30 |
| 41 | + --> tests/ui/cast_raw_slice_pointer_cast.rs:28:30 |
42 | 42 | |
|
43 | 43 | LL | let _: *const [u8] = unsafe { one::from_raw_parts(ptr, 1) } as *const [u8];
|
44 |
| - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `core::ptr::slice_from_raw_parts(ptr, 1)` |
| 44 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `std::ptr::slice_from_raw_parts(ptr, 1)` |
45 | 45 |
|
46 |
| -error: aborting due to 7 previous errors |
| 46 | +error: implicitly casting the result of `from_raw_parts` to `*const [u8]` |
| 47 | + --> tests/ui/cast_raw_slice_pointer_cast.rs:34:39 |
| 48 | + | |
| 49 | +LL | let _: *const [u8] = unsafe { std::slice::from_raw_parts(ptr, 1) }; |
| 50 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace_with: `std::ptr::slice_from_raw_parts(ptr, 1)` |
| 51 | + |
| 52 | +error: implicitly casting the result of `from_raw_parts_mut` to `*mut [u8]` |
| 53 | + --> tests/ui/cast_raw_slice_pointer_cast.rs:36:37 |
| 54 | + | |
| 55 | +LL | let _: *mut [u8] = unsafe { std::slice::from_raw_parts_mut(mptr, 1) }; |
| 56 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace_with: `std::ptr::slice_from_raw_parts_mut(mptr, 1)` |
| 57 | + |
| 58 | +error: implicitly casting the result of `from_raw_parts` to `*const [u8]` |
| 59 | + --> tests/ui/cast_raw_slice_pointer_cast.rs:38:40 |
| 60 | + | |
| 61 | +LL | require_raw_slice_ptr(unsafe { std::slice::from_raw_parts(ptr, 1) }); |
| 62 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace_with: `std::ptr::slice_from_raw_parts(ptr, 1)` |
| 63 | + |
| 64 | +error: implicitly casting the result of `from_raw_parts` to `*const [u8]` |
| 65 | + --> tests/ui/cast_raw_slice_pointer_cast.rs:46:39 |
| 66 | + | |
| 67 | +LL | let _: *const [u8] = unsafe { std::slice::from_raw_parts(PTR, 1) }; |
| 68 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace_with: `std::ptr::slice_from_raw_parts(PTR, 1)` |
| 69 | + |
| 70 | +error: implicitly casting the result of `from_raw_parts_mut` to `*mut [u8]` |
| 71 | + --> tests/ui/cast_raw_slice_pointer_cast.rs:48:37 |
| 72 | + | |
| 73 | +LL | let _: *mut [u8] = unsafe { std::slice::from_raw_parts_mut(MPTR, 1) }; |
| 74 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace_with: `std::ptr::slice_from_raw_parts_mut(MPTR, 1)` |
| 75 | + |
| 76 | +error: implicitly casting the result of `from_raw_parts` to `*const [u8]` |
| 77 | + --> tests/ui/cast_raw_slice_pointer_cast.rs:50:40 |
| 78 | + | |
| 79 | +LL | require_raw_slice_ptr(unsafe { std::slice::from_raw_parts(PTR, 1) }); |
| 80 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace_with: `std::ptr::slice_from_raw_parts(PTR, 1)` |
| 81 | + |
| 82 | +error: aborting due to 13 previous errors |
47 | 83 |
|
0 commit comments