]> git.proxmox.com Git - rustc.git/blob - src/test/ui/consts/const-eval/const-pointer-values-in-various-types.64bit.stderr
New upstream version 1.55.0+dfsg1
[rustc.git] / src / test / ui / consts / const-eval / const-pointer-values-in-various-types.64bit.stderr
1 error[E0080]: it is undefined behavior to use this value
2 --> $DIR/const-pointer-values-in-various-types.rs:26:5
3 |
4 LL | const I32_REF_USIZE_UNION: usize = unsafe { Nonsense { int_32_ref: &3 }.u };
5 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered pointer to alloc3, but expected initialized plain (non-pointer) bytes
6 |
7 = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
8 = note: the raw bytes of the constant (size: 8, align: 8) {
9 ╾───────alloc3────────╼ │ ╾──────╼
10 }
11
12 error: any use of this value will cause an error
13 --> $DIR/const-pointer-values-in-various-types.rs:29:43
14 |
15 LL | const I32_REF_U8_UNION: u8 = unsafe { Nonsense { int_32_ref: &3 }.uint_8 };
16 | --------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
17 | |
18 | unable to turn pointer into raw bytes
19 |
20 = note: `#[deny(const_err)]` on by default
21 = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
22 = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
23
24 error: any use of this value will cause an error
25 --> $DIR/const-pointer-values-in-various-types.rs:33:45
26 |
27 LL | const I32_REF_U16_UNION: u16 = unsafe { Nonsense { int_32_ref: &3 }.uint_16 };
28 | ----------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
29 | |
30 | unable to turn pointer into raw bytes
31 |
32 = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
33 = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
34
35 error: any use of this value will cause an error
36 --> $DIR/const-pointer-values-in-various-types.rs:37:45
37 |
38 LL | const I32_REF_U32_UNION: u32 = unsafe { Nonsense { int_32_ref: &3 }.uint_32 };
39 | ----------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
40 | |
41 | unable to turn pointer into raw bytes
42 |
43 = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
44 = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
45
46 error[E0080]: it is undefined behavior to use this value
47 --> $DIR/const-pointer-values-in-various-types.rs:41:5
48 |
49 LL | const I32_REF_U64_UNION: u64 = unsafe { Nonsense { int_32_ref: &3 }.uint_64 };
50 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered pointer to alloc19, but expected initialized plain (non-pointer) bytes
51 |
52 = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
53 = note: the raw bytes of the constant (size: 8, align: 8) {
54 ╾───────alloc19───────╼ │ ╾──────╼
55 }
56
57 error[E0080]: it is undefined behavior to use this value
58 --> $DIR/const-pointer-values-in-various-types.rs:44:5
59 |
60 LL | const I32_REF_U128_UNION: u128 = unsafe { Nonsense { int_32_ref: &3 }.uint_128 };
61 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered uninitialized bytes, but expected initialized plain (non-pointer) bytes
62 |
63 = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
64 = note: the raw bytes of the constant (size: 16, align: 8) {
65 __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ │ ░░░░░░░░░░░░░░░░
66 }
67
68 error: any use of this value will cause an error
69 --> $DIR/const-pointer-values-in-various-types.rs:47:43
70 |
71 LL | const I32_REF_I8_UNION: i8 = unsafe { Nonsense { int_32_ref: &3 }.int_8 };
72 | --------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
73 | |
74 | unable to turn pointer into raw bytes
75 |
76 = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
77 = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
78
79 error: any use of this value will cause an error
80 --> $DIR/const-pointer-values-in-various-types.rs:51:45
81 |
82 LL | const I32_REF_I16_UNION: i16 = unsafe { Nonsense { int_32_ref: &3 }.int_16 };
83 | ----------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
84 | |
85 | unable to turn pointer into raw bytes
86 |
87 = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
88 = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
89
90 error: any use of this value will cause an error
91 --> $DIR/const-pointer-values-in-various-types.rs:55:45
92 |
93 LL | const I32_REF_I32_UNION: i32 = unsafe { Nonsense { int_32_ref: &3 }.int_32 };
94 | ----------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
95 | |
96 | unable to turn pointer into raw bytes
97 |
98 = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
99 = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
100
101 error[E0080]: it is undefined behavior to use this value
102 --> $DIR/const-pointer-values-in-various-types.rs:59:5
103 |
104 LL | const I32_REF_I64_UNION: i64 = unsafe { Nonsense { int_32_ref: &3 }.int_64 };
105 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered pointer to alloc39, but expected initialized plain (non-pointer) bytes
106 |
107 = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
108 = note: the raw bytes of the constant (size: 8, align: 8) {
109 ╾───────alloc39───────╼ │ ╾──────╼
110 }
111
112 error[E0080]: it is undefined behavior to use this value
113 --> $DIR/const-pointer-values-in-various-types.rs:62:5
114 |
115 LL | const I32_REF_I128_UNION: i128 = unsafe { Nonsense { int_32_ref: &3 }.int_128 };
116 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered uninitialized bytes, but expected initialized plain (non-pointer) bytes
117 |
118 = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
119 = note: the raw bytes of the constant (size: 16, align: 8) {
120 __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ │ ░░░░░░░░░░░░░░░░
121 }
122
123 error: any use of this value will cause an error
124 --> $DIR/const-pointer-values-in-various-types.rs:65:45
125 |
126 LL | const I32_REF_F32_UNION: f32 = unsafe { Nonsense { int_32_ref: &3 }.float_32 };
127 | ----------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
128 | |
129 | unable to turn pointer into raw bytes
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 #71800 <https://github.com/rust-lang/rust/issues/71800>
133
134 error[E0080]: it is undefined behavior to use this value
135 --> $DIR/const-pointer-values-in-various-types.rs:69:5
136 |
137 LL | const I32_REF_F64_UNION: f64 = unsafe { Nonsense { int_32_ref: &3 }.float_64 };
138 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered pointer to alloc51, but expected initialized plain (non-pointer) bytes
139 |
140 = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
141 = note: the raw bytes of the constant (size: 8, align: 8) {
142 ╾───────alloc51───────╼ │ ╾──────╼
143 }
144
145 error: any use of this value will cause an error
146 --> $DIR/const-pointer-values-in-various-types.rs:72:47
147 |
148 LL | const I32_REF_BOOL_UNION: bool = unsafe { Nonsense { int_32_ref: &3 }.truthy_falsey };
149 | ------------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
150 | |
151 | unable to turn pointer into raw bytes
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 #71800 <https://github.com/rust-lang/rust/issues/71800>
155
156 error: any use of this value will cause an error
157 --> $DIR/const-pointer-values-in-various-types.rs:76:47
158 |
159 LL | const I32_REF_CHAR_UNION: char = unsafe { Nonsense { int_32_ref: &3 }.character };
160 | ------------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
161 | |
162 | unable to turn pointer into raw bytes
163 |
164 = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
165 = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
166
167 error: any use of this value will cause an error
168 --> $DIR/const-pointer-values-in-various-types.rs:80:39
169 |
170 LL | const STR_U8_UNION: u8 = unsafe { Nonsense { stringy: "3" }.uint_8 };
171 | ----------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
172 | |
173 | unable to turn pointer into raw bytes
174 |
175 = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
176 = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
177
178 error: any use of this value will cause an error
179 --> $DIR/const-pointer-values-in-various-types.rs:84:41
180 |
181 LL | const STR_U16_UNION: u16 = unsafe { Nonsense { stringy: "3" }.uint_16 };
182 | ------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
183 | |
184 | unable to turn pointer into raw bytes
185 |
186 = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
187 = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
188
189 error: any use of this value will cause an error
190 --> $DIR/const-pointer-values-in-various-types.rs:88:41
191 |
192 LL | const STR_U32_UNION: u32 = unsafe { Nonsense { stringy: "3" }.uint_32 };
193 | ------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
194 | |
195 | unable to turn pointer into raw bytes
196 |
197 = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
198 = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
199
200 error[E0080]: it is undefined behavior to use this value
201 --> $DIR/const-pointer-values-in-various-types.rs:92:5
202 |
203 LL | const STR_U64_UNION: u64 = unsafe { Nonsense { stringy: "3" }.uint_64 };
204 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered pointer to alloc72, but expected initialized plain (non-pointer) bytes
205 |
206 = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
207 = note: the raw bytes of the constant (size: 8, align: 8) {
208 ╾───────alloc72───────╼ │ ╾──────╼
209 }
210
211 error: any use of this value will cause an error
212 --> $DIR/const-pointer-values-in-various-types.rs:95:43
213 |
214 LL | const STR_U128_UNION: u128 = unsafe { Nonsense { stringy: "3" }.uint_128 };
215 | --------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
216 | |
217 | unable to turn pointer into raw bytes
218 |
219 = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
220 = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
221
222 error: any use of this value will cause an error
223 --> $DIR/const-pointer-values-in-various-types.rs:99:39
224 |
225 LL | const STR_I8_UNION: i8 = unsafe { Nonsense { stringy: "3" }.int_8 };
226 | ----------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
227 | |
228 | unable to turn pointer into raw bytes
229 |
230 = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
231 = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
232
233 error: any use of this value will cause an error
234 --> $DIR/const-pointer-values-in-various-types.rs:103:41
235 |
236 LL | const STR_I16_UNION: i16 = unsafe { Nonsense { stringy: "3" }.int_16 };
237 | ------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
238 | |
239 | unable to turn pointer into raw bytes
240 |
241 = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
242 = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
243
244 error: any use of this value will cause an error
245 --> $DIR/const-pointer-values-in-various-types.rs:107:41
246 |
247 LL | const STR_I32_UNION: i32 = unsafe { Nonsense { stringy: "3" }.int_32 };
248 | ------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
249 | |
250 | unable to turn pointer into raw bytes
251 |
252 = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
253 = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
254
255 error[E0080]: it is undefined behavior to use this value
256 --> $DIR/const-pointer-values-in-various-types.rs:111:5
257 |
258 LL | const STR_I64_UNION: i64 = unsafe { Nonsense { stringy: "3" }.int_64 };
259 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered pointer to alloc87, but expected initialized plain (non-pointer) bytes
260 |
261 = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
262 = note: the raw bytes of the constant (size: 8, align: 8) {
263 ╾───────alloc87───────╼ │ ╾──────╼
264 }
265
266 error: any use of this value will cause an error
267 --> $DIR/const-pointer-values-in-various-types.rs:114:43
268 |
269 LL | const STR_I128_UNION: i128 = unsafe { Nonsense { stringy: "3" }.int_128 };
270 | --------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
271 | |
272 | unable to turn pointer into raw bytes
273 |
274 = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
275 = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
276
277 error: any use of this value will cause an error
278 --> $DIR/const-pointer-values-in-various-types.rs:118:41
279 |
280 LL | const STR_F32_UNION: f32 = unsafe { Nonsense { stringy: "3" }.float_32 };
281 | ------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
282 | |
283 | unable to turn pointer into raw bytes
284 |
285 = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
286 = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
287
288 error[E0080]: it is undefined behavior to use this value
289 --> $DIR/const-pointer-values-in-various-types.rs:122:5
290 |
291 LL | const STR_F64_UNION: f64 = unsafe { Nonsense { stringy: "3" }.float_64 };
292 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered pointer to alloc96, but expected initialized plain (non-pointer) bytes
293 |
294 = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
295 = note: the raw bytes of the constant (size: 8, align: 8) {
296 ╾───────alloc96───────╼ │ ╾──────╼
297 }
298
299 error: any use of this value will cause an error
300 --> $DIR/const-pointer-values-in-various-types.rs:125:43
301 |
302 LL | const STR_BOOL_UNION: bool = unsafe { Nonsense { stringy: "3" }.truthy_falsey };
303 | --------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
304 | |
305 | unable to turn pointer into raw bytes
306 |
307 = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
308 = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
309
310 error: any use of this value will cause an error
311 --> $DIR/const-pointer-values-in-various-types.rs:129:43
312 |
313 LL | const STR_CHAR_UNION: char = unsafe { Nonsense { stringy: "3" }.character };
314 | --------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
315 | |
316 | unable to turn pointer into raw bytes
317 |
318 = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
319 = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
320
321 error: aborting due to 29 previous errors
322
323 For more information about this error, try `rustc --explain E0080`.