1 error[E0080]: it is undefined behavior to use this value
2 --> $DIR/const-pointer-values-in-various-types.rs:24:5
4 LL | const I32_REF_USIZE_UNION: usize = unsafe { Nonsense { int_32_ref: &3 }.u };
5 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered a pointer, 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 rust compiler repository if you believe it should not be considered undefined behavior
9 error: any use of this value will cause an error
10 --> $DIR/const-pointer-values-in-various-types.rs:27:5
12 LL | const I32_REF_U8_UNION: u8 = unsafe { Nonsense { int_32_ref: &3 }.uint_8 };
13 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^----------------------------------^^^
15 | a raw memory access tried to access part of a pointer value as raw bytes
17 = note: #[deny(const_err)] on by default
19 error: any use of this value will cause an error
20 --> $DIR/const-pointer-values-in-various-types.rs:30:5
22 LL | const I32_REF_U16_UNION: u16 = unsafe { Nonsense { int_32_ref: &3 }.uint_16 };
23 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-----------------------------------^^^
25 | a raw memory access tried to access part of a pointer value as raw bytes
27 error: any use of this value will cause an error
28 --> $DIR/const-pointer-values-in-various-types.rs:33:5
30 LL | const I32_REF_U32_UNION: u32 = unsafe { Nonsense { int_32_ref: &3 }.uint_32 };
31 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-----------------------------------^^^
33 | a raw memory access tried to access part of a pointer value as raw bytes
35 error[E0080]: it is undefined behavior to use this value
36 --> $DIR/const-pointer-values-in-various-types.rs:36:5
38 LL | const I32_REF_U64_UNION: u64 = unsafe { Nonsense { int_32_ref: &3 }.uint_64 };
39 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered a pointer, but expected initialized plain (non-pointer) bytes
41 = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rust compiler repository if you believe it should not be considered undefined behavior
43 error: any use of this value will cause an error
44 --> $DIR/const-pointer-values-in-various-types.rs:39:5
46 LL | const I32_REF_U128_UNION: u128 = unsafe { Nonsense { int_32_ref: &3 }.uint_128 };
47 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ attempted to read undefined bytes
49 error: any use of this value will cause an error
50 --> $DIR/const-pointer-values-in-various-types.rs:42:5
52 LL | const I32_REF_I8_UNION: i8 = unsafe { Nonsense { int_32_ref: &3 }.int_8 };
53 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---------------------------------^^^
55 | a raw memory access tried to access part of a pointer value as raw bytes
57 error: any use of this value will cause an error
58 --> $DIR/const-pointer-values-in-various-types.rs:45:5
60 LL | const I32_REF_I16_UNION: i16 = unsafe { Nonsense { int_32_ref: &3 }.int_16 };
61 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^----------------------------------^^^
63 | a raw memory access tried to access part of a pointer value as raw bytes
65 error: any use of this value will cause an error
66 --> $DIR/const-pointer-values-in-various-types.rs:48:5
68 LL | const I32_REF_I32_UNION: i32 = unsafe { Nonsense { int_32_ref: &3 }.int_32 };
69 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^----------------------------------^^^
71 | a raw memory access tried to access part of a pointer value as raw bytes
73 error[E0080]: it is undefined behavior to use this value
74 --> $DIR/const-pointer-values-in-various-types.rs:51:5
76 LL | const I32_REF_I64_UNION: i64 = unsafe { Nonsense { int_32_ref: &3 }.int_64 };
77 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered a pointer, but expected initialized plain (non-pointer) bytes
79 = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rust compiler repository if you believe it should not be considered undefined behavior
81 error: any use of this value will cause an error
82 --> $DIR/const-pointer-values-in-various-types.rs:54:5
84 LL | const I32_REF_I128_UNION: i128 = unsafe { Nonsense { int_32_ref: &3 }.int_128 };
85 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ attempted to read undefined bytes
87 error: any use of this value will cause an error
88 --> $DIR/const-pointer-values-in-various-types.rs:57:5
90 LL | const I32_REF_F32_UNION: f32 = unsafe { Nonsense { int_32_ref: &3 }.float_32 };
91 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^------------------------------------^^^
93 | a raw memory access tried to access part of a pointer value as raw bytes
95 error[E0080]: it is undefined behavior to use this value
96 --> $DIR/const-pointer-values-in-various-types.rs:60:5
98 LL | const I32_REF_F64_UNION: f64 = unsafe { Nonsense { int_32_ref: &3 }.float_64 };
99 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered a pointer, but expected initialized plain (non-pointer) bytes
101 = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rust compiler repository if you believe it should not be considered undefined behavior
103 error: any use of this value will cause an error
104 --> $DIR/const-pointer-values-in-various-types.rs:63:5
106 LL | const I32_REF_BOOL_UNION: bool = unsafe { Nonsense { int_32_ref: &3 }.truthy_falsey };
107 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-----------------------------------------^^^
109 | a raw memory access tried to access part of a pointer value as raw bytes
111 error: any use of this value will cause an error
112 --> $DIR/const-pointer-values-in-various-types.rs:66:5
114 LL | const I32_REF_CHAR_UNION: char = unsafe { Nonsense { int_32_ref: &3 }.character };
115 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-------------------------------------^^^
117 | a raw memory access tried to access part of a pointer value as raw bytes
119 error: any use of this value will cause an error
120 --> $DIR/const-pointer-values-in-various-types.rs:69:5
122 LL | const STR_U8_UNION: u8 = unsafe { Nonsense { stringy: "3" }.uint_8 };
123 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^--------------------------------^^^
125 | a raw memory access tried to access part of a pointer value as raw bytes
127 error: any use of this value will cause an error
128 --> $DIR/const-pointer-values-in-various-types.rs:72:5
130 LL | const STR_U16_UNION: u16 = unsafe { Nonsense { stringy: "3" }.uint_16 };
131 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---------------------------------^^^
133 | a raw memory access tried to access part of a pointer value as raw bytes
135 error: any use of this value will cause an error
136 --> $DIR/const-pointer-values-in-various-types.rs:75:5
138 LL | const STR_U32_UNION: u32 = unsafe { Nonsense { stringy: "3" }.uint_32 };
139 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---------------------------------^^^
141 | a raw memory access tried to access part of a pointer value as raw bytes
143 error[E0080]: it is undefined behavior to use this value
144 --> $DIR/const-pointer-values-in-various-types.rs:78:5
146 LL | const STR_U64_UNION: u64 = unsafe { Nonsense { stringy: "3" }.uint_64 };
147 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered a pointer, but expected initialized plain (non-pointer) bytes
149 = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rust compiler repository if you believe it should not be considered undefined behavior
151 error: any use of this value will cause an error
152 --> $DIR/const-pointer-values-in-various-types.rs:81:5
154 LL | const STR_U128_UNION: u128 = unsafe { Nonsense { stringy: "3" }.uint_128 };
155 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^----------------------------------^^^
157 | a raw memory access tried to access part of a pointer value as raw bytes
159 error: any use of this value will cause an error
160 --> $DIR/const-pointer-values-in-various-types.rs:84:5
162 LL | const STR_I8_UNION: i8 = unsafe { Nonsense { stringy: "3" }.int_8 };
163 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-------------------------------^^^
165 | a raw memory access tried to access part of a pointer value as raw bytes
167 error: any use of this value will cause an error
168 --> $DIR/const-pointer-values-in-various-types.rs:87:5
170 LL | const STR_I16_UNION: i16 = unsafe { Nonsense { stringy: "3" }.int_16 };
171 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^--------------------------------^^^
173 | a raw memory access tried to access part of a pointer value as raw bytes
175 error: any use of this value will cause an error
176 --> $DIR/const-pointer-values-in-various-types.rs:90:5
178 LL | const STR_I32_UNION: i32 = unsafe { Nonsense { stringy: "3" }.int_32 };
179 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^--------------------------------^^^
181 | a raw memory access tried to access part of a pointer value as raw bytes
183 error[E0080]: it is undefined behavior to use this value
184 --> $DIR/const-pointer-values-in-various-types.rs:93:5
186 LL | const STR_I64_UNION: i64 = unsafe { Nonsense { stringy: "3" }.int_64 };
187 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered a pointer, but expected initialized plain (non-pointer) bytes
189 = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rust compiler repository if you believe it should not be considered undefined behavior
191 error: any use of this value will cause an error
192 --> $DIR/const-pointer-values-in-various-types.rs:96:5
194 LL | const STR_I128_UNION: i128 = unsafe { Nonsense { stringy: "3" }.int_128 };
195 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---------------------------------^^^
197 | a raw memory access tried to access part of a pointer value as raw bytes
199 error: any use of this value will cause an error
200 --> $DIR/const-pointer-values-in-various-types.rs:99:5
202 LL | const STR_F32_UNION: f32 = unsafe { Nonsense { stringy: "3" }.float_32 };
203 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^----------------------------------^^^
205 | a raw memory access tried to access part of a pointer value as raw bytes
207 error[E0080]: it is undefined behavior to use this value
208 --> $DIR/const-pointer-values-in-various-types.rs:102:5
210 LL | const STR_F64_UNION: f64 = unsafe { Nonsense { stringy: "3" }.float_64 };
211 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered a pointer, but expected initialized plain (non-pointer) bytes
213 = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rust compiler repository if you believe it should not be considered undefined behavior
215 error: any use of this value will cause an error
216 --> $DIR/const-pointer-values-in-various-types.rs:105:5
218 LL | const STR_BOOL_UNION: bool = unsafe { Nonsense { stringy: "3" }.truthy_falsey };
219 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---------------------------------------^^^
221 | a raw memory access tried to access part of a pointer value as raw bytes
223 error: any use of this value will cause an error
224 --> $DIR/const-pointer-values-in-various-types.rs:108:5
226 LL | const STR_CHAR_UNION: char = unsafe { Nonsense { stringy: "3" }.character };
227 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-----------------------------------^^^
229 | a raw memory access tried to access part of a pointer value as raw bytes
231 error: aborting due to 29 previous errors
233 For more information about this error, try `rustc --explain E0080`.