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[E0080]: it is undefined behavior to use this value
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 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered uninitialized bytes, but expected initialized plain bits
49 = 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
51 error: any use of this value will cause an error
52 --> $DIR/const-pointer-values-in-various-types.rs:42:5
54 LL | const I32_REF_I8_UNION: i8 = unsafe { Nonsense { int_32_ref: &3 }.int_8 };
55 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---------------------------------^^^
57 | a raw memory access tried to access part of a pointer value as raw bytes
59 error: any use of this value will cause an error
60 --> $DIR/const-pointer-values-in-various-types.rs:45:5
62 LL | const I32_REF_I16_UNION: i16 = unsafe { Nonsense { int_32_ref: &3 }.int_16 };
63 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^----------------------------------^^^
65 | a raw memory access tried to access part of a pointer value as raw bytes
67 error: any use of this value will cause an error
68 --> $DIR/const-pointer-values-in-various-types.rs:48:5
70 LL | const I32_REF_I32_UNION: i32 = unsafe { Nonsense { int_32_ref: &3 }.int_32 };
71 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^----------------------------------^^^
73 | a raw memory access tried to access part of a pointer value as raw bytes
75 error[E0080]: it is undefined behavior to use this value
76 --> $DIR/const-pointer-values-in-various-types.rs:51:5
78 LL | const I32_REF_I64_UNION: i64 = unsafe { Nonsense { int_32_ref: &3 }.int_64 };
79 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered a pointer, but expected initialized plain (non-pointer) bytes
81 = 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
83 error[E0080]: it is undefined behavior to use this value
84 --> $DIR/const-pointer-values-in-various-types.rs:54:5
86 LL | const I32_REF_I128_UNION: i128 = unsafe { Nonsense { int_32_ref: &3 }.int_128 };
87 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered uninitialized bytes, but expected initialized plain bits
89 = 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
91 error: any use of this value will cause an error
92 --> $DIR/const-pointer-values-in-various-types.rs:57:5
94 LL | const I32_REF_F32_UNION: f32 = unsafe { Nonsense { int_32_ref: &3 }.float_32 };
95 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^------------------------------------^^^
97 | a raw memory access tried to access part of a pointer value as raw bytes
99 error[E0080]: it is undefined behavior to use this value
100 --> $DIR/const-pointer-values-in-various-types.rs:60:5
102 LL | const I32_REF_F64_UNION: f64 = unsafe { Nonsense { int_32_ref: &3 }.float_64 };
103 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered a pointer, but expected initialized plain (non-pointer) bytes
105 = 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
107 error: any use of this value will cause an error
108 --> $DIR/const-pointer-values-in-various-types.rs:63:5
110 LL | const I32_REF_BOOL_UNION: bool = unsafe { Nonsense { int_32_ref: &3 }.truthy_falsey };
111 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-----------------------------------------^^^
113 | a raw memory access tried to access part of a pointer value as raw bytes
115 error: any use of this value will cause an error
116 --> $DIR/const-pointer-values-in-various-types.rs:66:5
118 LL | const I32_REF_CHAR_UNION: char = unsafe { Nonsense { int_32_ref: &3 }.character };
119 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-------------------------------------^^^
121 | a raw memory access tried to access part of a pointer value as raw bytes
123 error: any use of this value will cause an error
124 --> $DIR/const-pointer-values-in-various-types.rs:69:5
126 LL | const STR_U8_UNION: u8 = unsafe { Nonsense { stringy: "3" }.uint_8 };
127 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^--------------------------------^^^
129 | a raw memory access tried to access part of a pointer value as raw bytes
131 error: any use of this value will cause an error
132 --> $DIR/const-pointer-values-in-various-types.rs:72:5
134 LL | const STR_U16_UNION: u16 = unsafe { Nonsense { stringy: "3" }.uint_16 };
135 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---------------------------------^^^
137 | a raw memory access tried to access part of a pointer value as raw bytes
139 error: any use of this value will cause an error
140 --> $DIR/const-pointer-values-in-various-types.rs:75:5
142 LL | const STR_U32_UNION: u32 = unsafe { Nonsense { stringy: "3" }.uint_32 };
143 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---------------------------------^^^
145 | a raw memory access tried to access part of a pointer value as raw bytes
147 error[E0080]: it is undefined behavior to use this value
148 --> $DIR/const-pointer-values-in-various-types.rs:78:5
150 LL | const STR_U64_UNION: u64 = unsafe { Nonsense { stringy: "3" }.uint_64 };
151 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered a pointer, but expected initialized plain (non-pointer) bytes
153 = 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
155 error: any use of this value will cause an error
156 --> $DIR/const-pointer-values-in-various-types.rs:81:5
158 LL | const STR_U128_UNION: u128 = unsafe { Nonsense { stringy: "3" }.uint_128 };
159 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^----------------------------------^^^
161 | a raw memory access tried to access part of a pointer value as raw bytes
163 error: any use of this value will cause an error
164 --> $DIR/const-pointer-values-in-various-types.rs:84:5
166 LL | const STR_I8_UNION: i8 = unsafe { Nonsense { stringy: "3" }.int_8 };
167 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-------------------------------^^^
169 | a raw memory access tried to access part of a pointer value as raw bytes
171 error: any use of this value will cause an error
172 --> $DIR/const-pointer-values-in-various-types.rs:87:5
174 LL | const STR_I16_UNION: i16 = unsafe { Nonsense { stringy: "3" }.int_16 };
175 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^--------------------------------^^^
177 | a raw memory access tried to access part of a pointer value as raw bytes
179 error: any use of this value will cause an error
180 --> $DIR/const-pointer-values-in-various-types.rs:90:5
182 LL | const STR_I32_UNION: i32 = unsafe { Nonsense { stringy: "3" }.int_32 };
183 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^--------------------------------^^^
185 | a raw memory access tried to access part of a pointer value as raw bytes
187 error[E0080]: it is undefined behavior to use this value
188 --> $DIR/const-pointer-values-in-various-types.rs:93:5
190 LL | const STR_I64_UNION: i64 = unsafe { Nonsense { stringy: "3" }.int_64 };
191 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered a pointer, but expected initialized plain (non-pointer) bytes
193 = 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
195 error: any use of this value will cause an error
196 --> $DIR/const-pointer-values-in-various-types.rs:96:5
198 LL | const STR_I128_UNION: i128 = unsafe { Nonsense { stringy: "3" }.int_128 };
199 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---------------------------------^^^
201 | a raw memory access tried to access part of a pointer value as raw bytes
203 error: any use of this value will cause an error
204 --> $DIR/const-pointer-values-in-various-types.rs:99:5
206 LL | const STR_F32_UNION: f32 = unsafe { Nonsense { stringy: "3" }.float_32 };
207 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^----------------------------------^^^
209 | a raw memory access tried to access part of a pointer value as raw bytes
211 error[E0080]: it is undefined behavior to use this value
212 --> $DIR/const-pointer-values-in-various-types.rs:102:5
214 LL | const STR_F64_UNION: f64 = unsafe { Nonsense { stringy: "3" }.float_64 };
215 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered a pointer, but expected initialized plain (non-pointer) bytes
217 = 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
219 error: any use of this value will cause an error
220 --> $DIR/const-pointer-values-in-various-types.rs:105:5
222 LL | const STR_BOOL_UNION: bool = unsafe { Nonsense { stringy: "3" }.truthy_falsey };
223 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---------------------------------------^^^
225 | a raw memory access tried to access part of a pointer value as raw bytes
227 error: any use of this value will cause an error
228 --> $DIR/const-pointer-values-in-various-types.rs:108:5
230 LL | const STR_CHAR_UNION: char = unsafe { Nonsense { stringy: "3" }.character };
231 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-----------------------------------^^^
233 | a raw memory access tried to access part of a pointer value as raw bytes
235 error: aborting due to 29 previous errors
237 For more information about this error, try `rustc --explain E0080`.