11error: 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
33 |
44LL | let _: *const [u8] = unsafe { std::slice::from_raw_parts(ptr, 1) as *const [u8] };
55 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `core::ptr::slice_from_raw_parts(ptr, 1)`
@@ -8,40 +8,76 @@ LL | let _: *const [u8] = unsafe { std::slice::from_raw_parts(ptr, 1) as *co
88 = help: to override `-D warnings` add `#[allow(clippy::cast_slice_from_raw_parts)]`
99
1010error: 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
1212 |
1313LL | let _: *const [u8] = unsafe { std::slice::from_raw_parts_mut(mptr, 1) as *mut [u8] };
1414 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `core::ptr::slice_from_raw_parts_mut(mptr, 1)`
1515
1616error: 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
1818 |
1919LL | let _: *const [u8] = unsafe { std::slice::from_raw_parts(ptr, 1) } as *const [u8];
2020 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `core::ptr::slice_from_raw_parts(ptr, 1)`
2121
2222error: 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
2424 |
2525LL | let _: *const [u8] = unsafe { slice::from_raw_parts(ptr, 1) } as *const [u8];
2626 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `core::ptr::slice_from_raw_parts(ptr, 1)`
2727
2828error: 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
3030 |
3131LL | let _: *const [u8] = unsafe { one::from_raw_parts(ptr, 1) } as *const [u8];
3232 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `core::ptr::slice_from_raw_parts(ptr, 1)`
3333
3434error: 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
3636 |
3737LL | let _: *const [u8] = unsafe { slice::from_raw_parts(ptr, 1) } as *const [u8];
3838 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `core::ptr::slice_from_raw_parts(ptr, 1)`
3939
4040error: 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
4242 |
4343LL | let _: *const [u8] = unsafe { one::from_raw_parts(ptr, 1) } as *const [u8];
4444 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `core::ptr::slice_from_raw_parts(ptr, 1)`
4545
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: `core::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: `core::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: `core::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
4783
0 commit comments