]> git.lizzy.rs Git - rust.git/blob - src/test/ui/lint/unaligned_references.stderr
Auto merge of #2583 - RalfJung:rustup, r=oli-obk
[rust.git] / src / test / 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 note: the lint level is defined here
8   --> $DIR/unaligned_references.rs:1:9
9    |
10 LL | #![deny(unaligned_references)]
11    |         ^^^^^^^^^^^^^^^^^^^^
12    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
13    = note: for more information, see issue #82523 <https://github.com/rust-lang/rust/issues/82523>
14    = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
15    = 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)
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 note: the lint level is defined here
115   --> $DIR/unaligned_references.rs:1:9
116    |
117 LL | #![deny(unaligned_references)]
118    |         ^^^^^^^^^^^^^^^^^^^^
119    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
120    = note: for more information, see issue #82523 <https://github.com/rust-lang/rust/issues/82523>
121    = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
122    = 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)
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 note: the lint level is defined here
132   --> $DIR/unaligned_references.rs:1:9
133    |
134 LL | #![deny(unaligned_references)]
135    |         ^^^^^^^^^^^^^^^^^^^^
136    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
137    = note: for more information, see issue #82523 <https://github.com/rust-lang/rust/issues/82523>
138    = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
139    = 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)
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 note: the lint level is defined here
149   --> $DIR/unaligned_references.rs:1:9
150    |
151 LL | #![deny(unaligned_references)]
152    |         ^^^^^^^^^^^^^^^^^^^^
153    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
154    = note: for more information, see issue #82523 <https://github.com/rust-lang/rust/issues/82523>
155    = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
156    = 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)
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 note: the lint level is defined here
166   --> $DIR/unaligned_references.rs:1:9
167    |
168 LL | #![deny(unaligned_references)]
169    |         ^^^^^^^^^^^^^^^^^^^^
170    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
171    = note: for more information, see issue #82523 <https://github.com/rust-lang/rust/issues/82523>
172    = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
173    = 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)
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 note: the lint level is defined here
183   --> $DIR/unaligned_references.rs:1:9
184    |
185 LL | #![deny(unaligned_references)]
186    |         ^^^^^^^^^^^^^^^^^^^^
187    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
188    = note: for more information, see issue #82523 <https://github.com/rust-lang/rust/issues/82523>
189    = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
190    = 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)
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 note: the lint level is defined here
200   --> $DIR/unaligned_references.rs:1:9
201    |
202 LL | #![deny(unaligned_references)]
203    |         ^^^^^^^^^^^^^^^^^^^^
204    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
205    = note: for more information, see issue #82523 <https://github.com/rust-lang/rust/issues/82523>
206    = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
207    = 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)
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 note: the lint level is defined here
217   --> $DIR/unaligned_references.rs:1:9
218    |
219 LL | #![deny(unaligned_references)]
220    |         ^^^^^^^^^^^^^^^^^^^^
221    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
222    = note: for more information, see issue #82523 <https://github.com/rust-lang/rust/issues/82523>
223    = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
224    = 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)
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 note: the lint level is defined here
234   --> $DIR/unaligned_references.rs:1:9
235    |
236 LL | #![deny(unaligned_references)]
237    |         ^^^^^^^^^^^^^^^^^^^^
238    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
239    = note: for more information, see issue #82523 <https://github.com/rust-lang/rust/issues/82523>
240    = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
241    = 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)
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 note: the lint level is defined here
251   --> $DIR/unaligned_references.rs:1:9
252    |
253 LL | #![deny(unaligned_references)]
254    |         ^^^^^^^^^^^^^^^^^^^^
255    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
256    = note: for more information, see issue #82523 <https://github.com/rust-lang/rust/issues/82523>
257    = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
258    = 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)
259