1 error[E0080]: it is undefined behavior to use this value
2 --> $DIR/const-pointer-values-in-various-types.rs:26:5
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
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────────╼ │ ╾──────╼
12 error: any use of this value will cause an error
13 --> $DIR/const-pointer-values-in-various-types.rs:29:43
15 LL | const I32_REF_U8_UNION: u8 = unsafe { Nonsense { int_32_ref: &3 }.uint_8 };
16 | --------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
18 | unable to turn pointer into raw bytes
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>
24 error: any use of this value will cause an error
25 --> $DIR/const-pointer-values-in-various-types.rs:33:45
27 LL | const I32_REF_U16_UNION: u16 = unsafe { Nonsense { int_32_ref: &3 }.uint_16 };
28 | ----------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
30 | unable to turn pointer into raw bytes
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>
35 error: any use of this value will cause an error
36 --> $DIR/const-pointer-values-in-various-types.rs:37:45
38 LL | const I32_REF_U32_UNION: u32 = unsafe { Nonsense { int_32_ref: &3 }.uint_32 };
39 | ----------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
41 | unable to turn pointer into raw bytes
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>
46 error[E0080]: it is undefined behavior to use this value
47 --> $DIR/const-pointer-values-in-various-types.rs:41:5
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
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───────╼ │ ╾──────╼
57 error[E0080]: it is undefined behavior to use this value
58 --> $DIR/const-pointer-values-in-various-types.rs:44:5
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
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 __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ │ ░░░░░░░░░░░░░░░░
68 error: any use of this value will cause an error
69 --> $DIR/const-pointer-values-in-various-types.rs:47:43
71 LL | const I32_REF_I8_UNION: i8 = unsafe { Nonsense { int_32_ref: &3 }.int_8 };
72 | --------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
74 | unable to turn pointer into raw bytes
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>
79 error: any use of this value will cause an error
80 --> $DIR/const-pointer-values-in-various-types.rs:51:45
82 LL | const I32_REF_I16_UNION: i16 = unsafe { Nonsense { int_32_ref: &3 }.int_16 };
83 | ----------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
85 | unable to turn pointer into raw bytes
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>
90 error: any use of this value will cause an error
91 --> $DIR/const-pointer-values-in-various-types.rs:55:45
93 LL | const I32_REF_I32_UNION: i32 = unsafe { Nonsense { int_32_ref: &3 }.int_32 };
94 | ----------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
96 | unable to turn pointer into raw bytes
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>
101 error[E0080]: it is undefined behavior to use this value
102 --> $DIR/const-pointer-values-in-various-types.rs:59:5
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
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───────╼ │ ╾──────╼
112 error[E0080]: it is undefined behavior to use this value
113 --> $DIR/const-pointer-values-in-various-types.rs:62:5
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
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 __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ │ ░░░░░░░░░░░░░░░░
123 error: any use of this value will cause an error
124 --> $DIR/const-pointer-values-in-various-types.rs:65:45
126 LL | const I32_REF_F32_UNION: f32 = unsafe { Nonsense { int_32_ref: &3 }.float_32 };
127 | ----------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
129 | unable to turn pointer into raw bytes
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>
134 error[E0080]: it is undefined behavior to use this value
135 --> $DIR/const-pointer-values-in-various-types.rs:69:5
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
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───────╼ │ ╾──────╼
145 error: any use of this value will cause an error
146 --> $DIR/const-pointer-values-in-various-types.rs:72:47
148 LL | const I32_REF_BOOL_UNION: bool = unsafe { Nonsense { int_32_ref: &3 }.truthy_falsey };
149 | ------------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
151 | unable to turn pointer into raw bytes
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>
156 error: any use of this value will cause an error
157 --> $DIR/const-pointer-values-in-various-types.rs:76:47
159 LL | const I32_REF_CHAR_UNION: char = unsafe { Nonsense { int_32_ref: &3 }.character };
160 | ------------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
162 | unable to turn pointer into raw bytes
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>
167 error: any use of this value will cause an error
168 --> $DIR/const-pointer-values-in-various-types.rs:80:39
170 LL | const STR_U8_UNION: u8 = unsafe { Nonsense { stringy: "3" }.uint_8 };
171 | ----------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
173 | unable to turn pointer into raw bytes
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>
178 error: any use of this value will cause an error
179 --> $DIR/const-pointer-values-in-various-types.rs:84:41
181 LL | const STR_U16_UNION: u16 = unsafe { Nonsense { stringy: "3" }.uint_16 };
182 | ------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
184 | unable to turn pointer into raw bytes
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>
189 error: any use of this value will cause an error
190 --> $DIR/const-pointer-values-in-various-types.rs:88:41
192 LL | const STR_U32_UNION: u32 = unsafe { Nonsense { stringy: "3" }.uint_32 };
193 | ------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
195 | unable to turn pointer into raw bytes
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>
200 error[E0080]: it is undefined behavior to use this value
201 --> $DIR/const-pointer-values-in-various-types.rs:92:5
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
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───────╼ │ ╾──────╼
211 error: any use of this value will cause an error
212 --> $DIR/const-pointer-values-in-various-types.rs:95:43
214 LL | const STR_U128_UNION: u128 = unsafe { Nonsense { stringy: "3" }.uint_128 };
215 | --------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
217 | unable to turn pointer into raw bytes
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>
222 error: any use of this value will cause an error
223 --> $DIR/const-pointer-values-in-various-types.rs:99:39
225 LL | const STR_I8_UNION: i8 = unsafe { Nonsense { stringy: "3" }.int_8 };
226 | ----------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
228 | unable to turn pointer into raw bytes
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>
233 error: any use of this value will cause an error
234 --> $DIR/const-pointer-values-in-various-types.rs:103:41
236 LL | const STR_I16_UNION: i16 = unsafe { Nonsense { stringy: "3" }.int_16 };
237 | ------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
239 | unable to turn pointer into raw bytes
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>
244 error: any use of this value will cause an error
245 --> $DIR/const-pointer-values-in-various-types.rs:107:41
247 LL | const STR_I32_UNION: i32 = unsafe { Nonsense { stringy: "3" }.int_32 };
248 | ------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
250 | unable to turn pointer into raw bytes
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>
255 error[E0080]: it is undefined behavior to use this value
256 --> $DIR/const-pointer-values-in-various-types.rs:111:5
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
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───────╼ │ ╾──────╼
266 error: any use of this value will cause an error
267 --> $DIR/const-pointer-values-in-various-types.rs:114:43
269 LL | const STR_I128_UNION: i128 = unsafe { Nonsense { stringy: "3" }.int_128 };
270 | --------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
272 | unable to turn pointer into raw bytes
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>
277 error: any use of this value will cause an error
278 --> $DIR/const-pointer-values-in-various-types.rs:118:41
280 LL | const STR_F32_UNION: f32 = unsafe { Nonsense { stringy: "3" }.float_32 };
281 | ------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
283 | unable to turn pointer into raw bytes
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>
288 error[E0080]: it is undefined behavior to use this value
289 --> $DIR/const-pointer-values-in-various-types.rs:122:5
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
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───────╼ │ ╾──────╼
299 error: any use of this value will cause an error
300 --> $DIR/const-pointer-values-in-various-types.rs:125:43
302 LL | const STR_BOOL_UNION: bool = unsafe { Nonsense { stringy: "3" }.truthy_falsey };
303 | --------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
305 | unable to turn pointer into raw bytes
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>
310 error: any use of this value will cause an error
311 --> $DIR/const-pointer-values-in-various-types.rs:129:43
313 LL | const STR_CHAR_UNION: char = unsafe { Nonsense { stringy: "3" }.character };
314 | --------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
316 | unable to turn pointer into raw bytes
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>
321 error: aborting due to 29 previous errors
323 For more information about this error, try `rustc --explain E0080`.