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 rust-lang#128703 - compiler-errors:normalizing-tails, r=lcnr
Miscellaneous improvements to struct tail normalization
1. Make checks for foreign tails more accurate by normalizing the struct tail. I didn't write a test for this one.
2. Normalize when computing struct tail for `offset_of` for slice/str. This fixes the new solver only.
3. Normalizing when computing tails for disaligned reference check. This fixes both solvers.
r? lcnr
Copy file name to clipboardExpand all lines: tests/ui/lint/unaligned_references.current.stderr
+13-13
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
error[E0793]: reference to packed field is unaligned
2
-
--> $DIR/unaligned_references.rs:28:13
2
+
--> $DIR/unaligned_references.rs:32:13
3
3
|
4
4
LL | &self.x;
5
5
| ^^^^^^^
@@ -9,7 +9,7 @@ LL | &self.x;
9
9
= help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers)
10
10
11
11
error[E0793]: reference to packed field is unaligned
12
-
--> $DIR/unaligned_references.rs:40:24
12
+
--> $DIR/unaligned_references.rs:44:24
13
13
|
14
14
LL | println!("{:?}", &*foo.0);
15
15
| ^^^^^
@@ -19,7 +19,7 @@ LL | println!("{:?}", &*foo.0);
19
19
= help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers)
20
20
21
21
error[E0793]: reference to packed field is unaligned
22
-
--> $DIR/unaligned_references.rs:42:24
22
+
--> $DIR/unaligned_references.rs:46:24
23
23
|
24
24
LL | println!("{:?}", &*foo.0);
25
25
| ^^^^^
@@ -29,7 +29,7 @@ LL | println!("{:?}", &*foo.0);
29
29
= help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers)
30
30
31
31
error[E0793]: reference to packed field is unaligned
32
-
--> $DIR/unaligned_references.rs:47:24
32
+
--> $DIR/unaligned_references.rs:51:24
33
33
|
34
34
LL | println!("{:?}", &*foo.0);
35
35
| ^^^^^
@@ -39,7 +39,7 @@ LL | println!("{:?}", &*foo.0);
39
39
= help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers)
40
40
41
41
error[E0793]: reference to packed field is unaligned
42
-
--> $DIR/unaligned_references.rs:57:17
42
+
--> $DIR/unaligned_references.rs:81:17
43
43
|
44
44
LL | let _ = &good.ptr;
45
45
| ^^^^^^^^^
@@ -49,7 +49,7 @@ LL | let _ = &good.ptr;
49
49
= help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers)
50
50
51
51
error[E0793]: reference to packed field is unaligned
52
-
--> $DIR/unaligned_references.rs:58:17
52
+
--> $DIR/unaligned_references.rs:82:17
53
53
|
54
54
LL | let _ = &good.data;
55
55
| ^^^^^^^^^^
@@ -59,7 +59,7 @@ LL | let _ = &good.data;
59
59
= help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers)
60
60
61
61
error[E0793]: reference to packed field is unaligned
62
-
--> $DIR/unaligned_references.rs:60:17
62
+
--> $DIR/unaligned_references.rs:84:17
63
63
|
64
64
LL | let _ = &good.data as *const _;
65
65
| ^^^^^^^^^^
@@ -69,7 +69,7 @@ LL | let _ = &good.data as *const _;
69
69
= help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers)
70
70
71
71
error[E0793]: reference to packed field is unaligned
= help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers)
80
80
81
81
error[E0793]: reference to packed field is unaligned
82
-
--> $DIR/unaligned_references.rs:63:17
82
+
--> $DIR/unaligned_references.rs:87:17
83
83
|
84
84
LL | let _ = good.data.clone();
85
85
| ^^^^^^^^^
@@ -89,7 +89,7 @@ LL | let _ = good.data.clone();
89
89
= help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers)
90
90
91
91
error[E0793]: reference to packed field is unaligned
92
-
--> $DIR/unaligned_references.rs:65:17
92
+
--> $DIR/unaligned_references.rs:89:17
93
93
|
94
94
LL | let _ = &good.data2[0];
95
95
| ^^^^^^^^^^^^^^
@@ -99,7 +99,7 @@ LL | let _ = &good.data2[0];
99
99
= help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers)
100
100
101
101
error[E0793]: reference to packed field is unaligned
102
-
--> $DIR/unaligned_references.rs:74:17
102
+
--> $DIR/unaligned_references.rs:98:17
103
103
|
104
104
LL | let _ = &packed2.x;
105
105
| ^^^^^^^^^^
@@ -109,7 +109,7 @@ LL | let _ = &packed2.x;
109
109
= help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers)
110
110
111
111
error[E0793]: reference to packed field is unaligned
112
-
--> $DIR/unaligned_references.rs:113:20
112
+
--> $DIR/unaligned_references.rs:137:20
113
113
|
114
114
LL | let _ref = &m1.1.a;
115
115
| ^^^^^^^
@@ -119,7 +119,7 @@ LL | let _ref = &m1.1.a;
119
119
= help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers)
120
120
121
121
error[E0793]: reference to packed field is unaligned
0 commit comments