You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Auto merge of #8563 - Jarcho:let_unit_1502, r=Jarcho
Don't lint `let_unit_value` when needed for type inferenece
fixes: #1502
Pinging `@dtolnay.` I think this is enough to fix the issue. Do you have a good list crates to test this on?
changelog: Don't lint `let_unit_value` when needed for type inference
Copy file name to clipboardExpand all lines: tests/ui/cast_slice_different_sizes.stderr
+6-6
Original file line number
Diff line number
Diff line change
@@ -1,31 +1,31 @@
1
1
error: casting between raw pointers to `[i32]` (element size 4) and `[u8]` (element size 1) does not adjust the count
2
-
--> $DIR/cast_slice_different_sizes.rs:7:13
2
+
--> $DIR/cast_slice_different_sizes.rs:9:13
3
3
|
4
4
LL | let b = a as *const [u8];
5
5
| ^^^^^^^^^^^^^^^^ help: replace with `ptr::slice_from_raw_parts`: `core::ptr::slice_from_raw_parts(a as *const u8, ..)`
6
6
|
7
7
= note: `#[deny(clippy::cast_slice_different_sizes)]` on by default
8
8
9
9
error: casting between raw pointers to `[u8]` (element size 1) and `[u32]` (element size 4) does not adjust the count
10
-
--> $DIR/cast_slice_different_sizes.rs:8:13
10
+
--> $DIR/cast_slice_different_sizes.rs:10:13
11
11
|
12
12
LL | let c = b as *const [u32];
13
13
| ^^^^^^^^^^^^^^^^^ help: replace with `ptr::slice_from_raw_parts`: `core::ptr::slice_from_raw_parts(b as *const u32, ..)`
14
14
15
15
error: casting between raw pointers to `[i32]` (element size 4) and `[u8]` (element size 1) does not adjust the count
16
-
--> $DIR/cast_slice_different_sizes.rs:11:16
16
+
--> $DIR/cast_slice_different_sizes.rs:13:16
17
17
|
18
18
LL | let loss = r_x as *const [i32] as *const [u8];
19
19
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with `ptr::slice_from_raw_parts`: `core::ptr::slice_from_raw_parts(r_x as *const [i32] as *const u8, ..)`
20
20
21
21
error: casting between raw pointers to `[i32]` (element size 4) and `[u8]` (element size 1) does not adjust the count
22
-
--> $DIR/cast_slice_different_sizes.rs:18:24
22
+
--> $DIR/cast_slice_different_sizes.rs:20:24
23
23
|
24
24
LL | let loss_block_1 = { r_x as *const [i32] } as *const [u8];
25
25
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with `ptr::slice_from_raw_parts`: `core::ptr::slice_from_raw_parts({ r_x as *const [i32] } as *const u8, ..)`
26
26
27
27
error: casting between raw pointers to `[i32]` (element size 4) and `[u8]` (element size 1) does not adjust the count
28
-
--> $DIR/cast_slice_different_sizes.rs:19:24
28
+
--> $DIR/cast_slice_different_sizes.rs:21:24
29
29
|
30
30
LL | let loss_block_2 = {
31
31
| ________________________^
@@ -43,7 +43,7 @@ LL ~ } as *const u8, ..);
43
43
|
44
44
45
45
error: casting between raw pointers to `[i32]` (element size 4) and `[u8]` (element size 1) does not adjust the count
46
-
--> $DIR/cast_slice_different_sizes.rs:36:27
46
+
--> $DIR/cast_slice_different_sizes.rs:38:27
47
47
|
48
48
LL | let long_chain_loss = r_x as *const [i32] as *const [u32] as *const [u16] as *const [i8] as *const [u8];
49
49
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with `ptr::slice_from_raw_parts`: `core::ptr::slice_from_raw_parts(r_x as *const [i32] as *const [u32] as *const [u16] as *const [i8] as *const u8, ..)`
0 commit comments