]> git.lizzy.rs Git - rust.git/blob - tests/ui/lint/unaligned_references.stderr
346f49b921e5c24a108a45128a67f3d14c6211b2
[rust.git] / tests / ui / lint / unaligned_references.stderr
1 error: reference to packed field is unaligned
2   --> $DIR/unaligned_references.rs:22:17
3    |
4 LL |         let _ = &good.ptr;
5    |                 ^^^^^^^^^
6    |
7    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
8    = note: for more information, see issue #82523 <https://github.com/rust-lang/rust/issues/82523>
9    = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
10    = 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)
11 note: the lint level is defined here
12   --> $DIR/unaligned_references.rs:1:9
13    |
14 LL | #![deny(unaligned_references)]
15    |         ^^^^^^^^^^^^^^^^^^^^
16
17 error: reference to packed field is unaligned
18   --> $DIR/unaligned_references.rs:24:17
19    |
20 LL |         let _ = &good.data;
21    |                 ^^^^^^^^^^
22    |
23    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
24    = note: for more information, see issue #82523 <https://github.com/rust-lang/rust/issues/82523>
25    = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
26    = 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)
27
28 error: reference to packed field is unaligned
29   --> $DIR/unaligned_references.rs:27:17
30    |
31 LL |         let _ = &good.data as *const _;
32    |                 ^^^^^^^^^^
33    |
34    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
35    = note: for more information, see issue #82523 <https://github.com/rust-lang/rust/issues/82523>
36    = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
37    = 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)
38
39 error: reference to packed field is unaligned
40   --> $DIR/unaligned_references.rs:29:27
41    |
42 LL |         let _: *const _ = &good.data;
43    |                           ^^^^^^^^^^
44    |
45    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
46    = note: for more information, see issue #82523 <https://github.com/rust-lang/rust/issues/82523>
47    = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
48    = 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)
49
50 error: reference to packed field is unaligned
51   --> $DIR/unaligned_references.rs:32:17
52    |
53 LL |         let _ = good.data.clone();
54    |                 ^^^^^^^^^^^^^^^^^
55    |
56    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
57    = note: for more information, see issue #82523 <https://github.com/rust-lang/rust/issues/82523>
58    = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
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
61 error: reference to packed field is unaligned
62   --> $DIR/unaligned_references.rs:35:17
63    |
64 LL |         let _ = &good.data2[0];
65    |                 ^^^^^^^^^^^^^^
66    |
67    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
68    = note: for more information, see issue #82523 <https://github.com/rust-lang/rust/issues/82523>
69    = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
70    = 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)
71
72 error: reference to packed field is unaligned
73   --> $DIR/unaligned_references.rs:45:17
74    |
75 LL |         let _ = &packed2.x;
76    |                 ^^^^^^^^^^
77    |
78    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
79    = note: for more information, see issue #82523 <https://github.com/rust-lang/rust/issues/82523>
80    = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
81    = 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)
82
83 error: reference to packed field is unaligned
84   --> $DIR/unaligned_references.rs:90:20
85    |
86 LL |         let _ref = &m1.1.a;
87    |                    ^^^^^^^
88    |
89    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
90    = note: for more information, see issue #82523 <https://github.com/rust-lang/rust/issues/82523>
91    = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
92    = 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)
93
94 error: reference to packed field is unaligned
95   --> $DIR/unaligned_references.rs:100:20
96    |
97 LL |         let _ref = &m2.1.a;
98    |                    ^^^^^^^
99    |
100    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
101    = note: for more information, see issue #82523 <https://github.com/rust-lang/rust/issues/82523>
102    = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
103    = 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)
104
105 error: aborting due to 9 previous errors
106
107 Future incompatibility report: Future breakage diagnostic:
108 error: reference to packed field is unaligned
109   --> $DIR/unaligned_references.rs:22:17
110    |
111 LL |         let _ = &good.ptr;
112    |                 ^^^^^^^^^
113    |
114    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
115    = note: for more information, see issue #82523 <https://github.com/rust-lang/rust/issues/82523>
116    = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
117    = 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)
118 note: the lint level is defined here
119   --> $DIR/unaligned_references.rs:1:9
120    |
121 LL | #![deny(unaligned_references)]
122    |         ^^^^^^^^^^^^^^^^^^^^
123
124 Future breakage diagnostic:
125 error: reference to packed field is unaligned
126   --> $DIR/unaligned_references.rs:24:17
127    |
128 LL |         let _ = &good.data;
129    |                 ^^^^^^^^^^
130    |
131    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
132    = note: for more information, see issue #82523 <https://github.com/rust-lang/rust/issues/82523>
133    = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
134    = 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)
135 note: the lint level is defined here
136   --> $DIR/unaligned_references.rs:1:9
137    |
138 LL | #![deny(unaligned_references)]
139    |         ^^^^^^^^^^^^^^^^^^^^
140
141 Future breakage diagnostic:
142 error: reference to packed field is unaligned
143   --> $DIR/unaligned_references.rs:27:17
144    |
145 LL |         let _ = &good.data as *const _;
146    |                 ^^^^^^^^^^
147    |
148    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
149    = note: for more information, see issue #82523 <https://github.com/rust-lang/rust/issues/82523>
150    = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
151    = 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)
152 note: the lint level is defined here
153   --> $DIR/unaligned_references.rs:1:9
154    |
155 LL | #![deny(unaligned_references)]
156    |         ^^^^^^^^^^^^^^^^^^^^
157
158 Future breakage diagnostic:
159 error: reference to packed field is unaligned
160   --> $DIR/unaligned_references.rs:29:27
161    |
162 LL |         let _: *const _ = &good.data;
163    |                           ^^^^^^^^^^
164    |
165    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
166    = note: for more information, see issue #82523 <https://github.com/rust-lang/rust/issues/82523>
167    = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
168    = 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)
169 note: the lint level is defined here
170   --> $DIR/unaligned_references.rs:1:9
171    |
172 LL | #![deny(unaligned_references)]
173    |         ^^^^^^^^^^^^^^^^^^^^
174
175 Future breakage diagnostic:
176 error: reference to packed field is unaligned
177   --> $DIR/unaligned_references.rs:32:17
178    |
179 LL |         let _ = good.data.clone();
180    |                 ^^^^^^^^^^^^^^^^^
181    |
182    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
183    = note: for more information, see issue #82523 <https://github.com/rust-lang/rust/issues/82523>
184    = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
185    = 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)
186 note: the lint level is defined here
187   --> $DIR/unaligned_references.rs:1:9
188    |
189 LL | #![deny(unaligned_references)]
190    |         ^^^^^^^^^^^^^^^^^^^^
191
192 Future breakage diagnostic:
193 error: reference to packed field is unaligned
194   --> $DIR/unaligned_references.rs:35:17
195    |
196 LL |         let _ = &good.data2[0];
197    |                 ^^^^^^^^^^^^^^
198    |
199    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
200    = note: for more information, see issue #82523 <https://github.com/rust-lang/rust/issues/82523>
201    = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
202    = 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)
203 note: the lint level is defined here
204   --> $DIR/unaligned_references.rs:1:9
205    |
206 LL | #![deny(unaligned_references)]
207    |         ^^^^^^^^^^^^^^^^^^^^
208
209 Future breakage diagnostic:
210 error: reference to packed field is unaligned
211   --> $DIR/unaligned_references.rs:45:17
212    |
213 LL |         let _ = &packed2.x;
214    |                 ^^^^^^^^^^
215    |
216    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
217    = note: for more information, see issue #82523 <https://github.com/rust-lang/rust/issues/82523>
218    = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
219    = 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)
220 note: the lint level is defined here
221   --> $DIR/unaligned_references.rs:1:9
222    |
223 LL | #![deny(unaligned_references)]
224    |         ^^^^^^^^^^^^^^^^^^^^
225
226 Future breakage diagnostic:
227 error: reference to packed field is unaligned
228   --> $DIR/unaligned_references.rs:90:20
229    |
230 LL |         let _ref = &m1.1.a;
231    |                    ^^^^^^^
232    |
233    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
234    = note: for more information, see issue #82523 <https://github.com/rust-lang/rust/issues/82523>
235    = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
236    = 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)
237 note: the lint level is defined here
238   --> $DIR/unaligned_references.rs:1:9
239    |
240 LL | #![deny(unaligned_references)]
241    |         ^^^^^^^^^^^^^^^^^^^^
242
243 Future breakage diagnostic:
244 error: reference to packed field is unaligned
245   --> $DIR/unaligned_references.rs:100:20
246    |
247 LL |         let _ref = &m2.1.a;
248    |                    ^^^^^^^
249    |
250    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
251    = note: for more information, see issue #82523 <https://github.com/rust-lang/rust/issues/82523>
252    = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
253    = 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)
254 note: the lint level is defined here
255   --> $DIR/unaligned_references.rs:1:9
256    |
257 LL | #![deny(unaligned_references)]
258    |         ^^^^^^^^^^^^^^^^^^^^
259