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:10 :35
3
3
|
4
4
LL | let _: *const [u8] = unsafe { std::slice::from_raw_parts(ptr, 1) as *const [u8] };
5
5
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `core::ptr::slice_from_raw_parts(ptr, 1)`
@@ -8,40 +8,58 @@ LL | let _: *const [u8] = unsafe { std::slice::from_raw_parts(ptr, 1) as *co
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:12 :35
12
12
|
13
13
LL | let _: *const [u8] = unsafe { std::slice::from_raw_parts_mut(mptr, 1) as *mut [u8] };
14
14
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `core::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:14 :26
18
18
|
19
19
LL | let _: *const [u8] = unsafe { std::slice::from_raw_parts(ptr, 1) } as *const [u8];
20
20
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `core::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:18 :30
24
24
|
25
25
LL | let _: *const [u8] = unsafe { slice::from_raw_parts(ptr, 1) } as *const [u8];
26
26
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `core::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:21 :30
30
30
|
31
31
LL | let _: *const [u8] = unsafe { one::from_raw_parts(ptr, 1) } as *const [u8];
32
32
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `core::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:26 :30
36
36
|
37
37
LL | let _: *const [u8] = unsafe { slice::from_raw_parts(ptr, 1) } as *const [u8];
38
38
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `core::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:29 :30
42
42
|
43
43
LL | let _: *const [u8] = unsafe { one::from_raw_parts(ptr, 1) } as *const [u8];
44
44
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `core::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:35: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:37: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:39: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: aborting due to 10 previous errors
47
65
0 commit comments