1 error[E0080]: it is undefined behavior to use this value
2 --> $DIR/raw-bytes.rs:20:1
4 LL | const BAD_ENUM: Enum = unsafe { mem::transmute(1usize) };
5 | ^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<enum-tag>: encountered 0x0000000000000001, but expected a valid enum tag
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 01 00 00 00 00 00 00 00 │ ........
12 error[E0080]: it is undefined behavior to use this value
13 --> $DIR/raw-bytes.rs:28:1
15 LL | const BAD_ENUM2: Enum2 = unsafe { mem::transmute(0usize) };
16 | ^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<enum-tag>: encountered 0x0000000000000000, but expected a valid enum tag
18 = 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.
19 = note: the raw bytes of the constant (size: 8, align: 8) {
20 00 00 00 00 00 00 00 00 │ ........
23 error[E0080]: it is undefined behavior to use this value
24 --> $DIR/raw-bytes.rs:42:1
26 LL | const BAD_UNINHABITED_VARIANT1: UninhDiscriminant = unsafe { mem::transmute(1u8) };
27 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<enum-variant(B)>.0: encountered a value of the never type `!`
29 = 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.
30 = note: the raw bytes of the constant (size: 1, align: 1) {
34 error[E0080]: it is undefined behavior to use this value
35 --> $DIR/raw-bytes.rs:44:1
37 LL | const BAD_UNINHABITED_VARIANT2: UninhDiscriminant = unsafe { mem::transmute(3u8) };
38 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<enum-variant(D)>.0: encountered a value of uninhabited type Never
40 = 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.
41 = note: the raw bytes of the constant (size: 1, align: 1) {
45 error[E0080]: it is undefined behavior to use this value
46 --> $DIR/raw-bytes.rs:50:1
48 LL | const BAD_OPTION_CHAR: Option<(char, char)> = Some(('x', unsafe { mem::transmute(!0u32) }));
49 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<enum-variant(Some)>.0.1: encountered 0xffffffff, but expected a valid unicode scalar value (in `0..=0x10FFFF` but not in `0xD800..=0xDFFF`)
51 = 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.
52 = note: the raw bytes of the constant (size: 8, align: 4) {
53 78 00 00 00 ff ff ff ff │ x.......
56 error[E0080]: it is undefined behavior to use this value
57 --> $DIR/raw-bytes.rs:54:1
59 LL | const NULL_PTR: NonNull<u8> = unsafe { mem::transmute(0usize) };
60 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered 0, but expected something greater or equal to 1
62 = 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.
63 = note: the raw bytes of the constant (size: 8, align: 8) {
64 00 00 00 00 00 00 00 00 │ ........
67 error[E0080]: it is undefined behavior to use this value
68 --> $DIR/raw-bytes.rs:57:1
70 LL | const NULL_U8: NonZeroU8 = unsafe { mem::transmute(0u8) };
71 | ^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered 0, but expected something greater or equal to 1
73 = 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.
74 = note: the raw bytes of the constant (size: 1, align: 1) {
78 error[E0080]: it is undefined behavior to use this value
79 --> $DIR/raw-bytes.rs:59:1
81 LL | const NULL_USIZE: NonZeroUsize = unsafe { mem::transmute(0usize) };
82 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered 0, but expected something greater or equal to 1
84 = 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.
85 = note: the raw bytes of the constant (size: 8, align: 8) {
86 00 00 00 00 00 00 00 00 │ ........
89 error[E0080]: it is undefined behavior to use this value
90 --> $DIR/raw-bytes.rs:65:1
92 LL | const BAD_RANGE1: RestrictedRange1 = unsafe { RestrictedRange1(42) };
93 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered 42, but expected something in the range 10..=30
95 = 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.
96 = note: the raw bytes of the constant (size: 4, align: 4) {
100 error[E0080]: it is undefined behavior to use this value
101 --> $DIR/raw-bytes.rs:71:1
103 LL | const BAD_RANGE2: RestrictedRange2 = unsafe { RestrictedRange2(20) };
104 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered 20, but expected something less or equal to 10, or greater or equal to 30
106 = 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.
107 = note: the raw bytes of the constant (size: 4, align: 4) {
111 error[E0080]: it is undefined behavior to use this value
112 --> $DIR/raw-bytes.rs:74:1
114 LL | const NULL_FAT_PTR: NonNull<dyn Send> = unsafe {
115 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered 0, but expected something greater or equal to 1
117 = 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.
118 = note: the raw bytes of the constant (size: 16, align: 8) {
119 00 00 00 00 00 00 00 00 ╾ALLOC_ID╼ │ ........╾──────╼
122 error[E0080]: it is undefined behavior to use this value
123 --> $DIR/raw-bytes.rs:82:1
125 LL | const UNALIGNED: &u16 = unsafe { mem::transmute(&[0u8; 4]) };
126 | ^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered an unaligned reference (required 2 byte alignment but found 1)
128 = 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.
129 = note: the raw bytes of the constant (size: 8, align: 8) {
130 ╾ALLOC_ID╼ │ ╾──────╼
133 error[E0080]: it is undefined behavior to use this value
134 --> $DIR/raw-bytes.rs:86:1
136 LL | const UNALIGNED_BOX: Box<u16> = unsafe { mem::transmute(&[0u8; 4]) };
137 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered an unaligned box (required 2 byte alignment but found 1)
139 = 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.
140 = note: the raw bytes of the constant (size: 8, align: 8) {
141 ╾ALLOC_ID╼ │ ╾──────╼
144 error[E0080]: it is undefined behavior to use this value
145 --> $DIR/raw-bytes.rs:90:1
147 LL | const NULL: &u16 = unsafe { mem::transmute(0usize) };
148 | ^^^^^^^^^^^^^^^^ constructing invalid value: encountered a null reference
150 = 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.
151 = note: the raw bytes of the constant (size: 8, align: 8) {
152 00 00 00 00 00 00 00 00 │ ........
155 error[E0080]: it is undefined behavior to use this value
156 --> $DIR/raw-bytes.rs:93:1
158 LL | const NULL_BOX: Box<u16> = unsafe { mem::transmute(0usize) };
159 | ^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a null box
161 = 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.
162 = note: the raw bytes of the constant (size: 8, align: 8) {
163 00 00 00 00 00 00 00 00 │ ........
166 error[E0080]: it is undefined behavior to use this value
167 --> $DIR/raw-bytes.rs:96:1
169 LL | const USIZE_AS_REF: &'static u8 = unsafe { mem::transmute(1337usize) };
170 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a dangling reference (0x539[noalloc] has no provenance)
172 = 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.
173 = note: the raw bytes of the constant (size: 8, align: 8) {
174 39 05 00 00 00 00 00 00 │ 9.......
177 error[E0080]: it is undefined behavior to use this value
178 --> $DIR/raw-bytes.rs:99:1
180 LL | const USIZE_AS_BOX: Box<u8> = unsafe { mem::transmute(1337usize) };
181 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a dangling box (0x539[noalloc] has no provenance)
183 = 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.
184 = note: the raw bytes of the constant (size: 8, align: 8) {
185 39 05 00 00 00 00 00 00 │ 9.......
188 error[E0080]: it is undefined behavior to use this value
189 --> $DIR/raw-bytes.rs:102:1
191 LL | const NULL_FN_PTR: fn() = unsafe { mem::transmute(0usize) };
192 | ^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered null pointer, but expected a function pointer
194 = 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.
195 = note: the raw bytes of the constant (size: 8, align: 8) {
196 00 00 00 00 00 00 00 00 │ ........
199 error[E0080]: it is undefined behavior to use this value
200 --> $DIR/raw-bytes.rs:104:1
202 LL | const DANGLING_FN_PTR: fn() = unsafe { mem::transmute(13usize) };
203 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered 0xd[noalloc], but expected a function pointer
205 = 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.
206 = note: the raw bytes of the constant (size: 8, align: 8) {
207 0d 00 00 00 00 00 00 00 │ ........
210 error[E0080]: it is undefined behavior to use this value
211 --> $DIR/raw-bytes.rs:106:1
213 LL | const DATA_FN_PTR: fn() = unsafe { mem::transmute(&13) };
214 | ^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered allocN, but expected a function pointer
216 = 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.
217 = note: the raw bytes of the constant (size: 8, align: 8) {
218 ╾ALLOC_ID╼ │ ╾──────╼
221 error[E0080]: it is undefined behavior to use this value
222 --> $DIR/raw-bytes.rs:112:1
224 LL | const BAD_BAD_REF: &Bar = unsafe { mem::transmute(1usize) };
225 | ^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a reference pointing to uninhabited type Bar
227 = 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.
228 = note: the raw bytes of the constant (size: 8, align: 8) {
229 01 00 00 00 00 00 00 00 │ ........
232 error[E0080]: it is undefined behavior to use this value
233 --> $DIR/raw-bytes.rs:137:1
235 LL | const STR_TOO_LONG: &str = unsafe { mem::transmute((&42u8, 999usize)) };
236 | ^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a dangling reference (going beyond the bounds of its allocation)
238 = 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.
239 = note: the raw bytes of the constant (size: 16, align: 8) {
240 ╾ALLOC_ID╼ e7 03 00 00 00 00 00 00 │ ╾──────╼........
243 error[E0080]: it is undefined behavior to use this value
244 --> $DIR/raw-bytes.rs:139:1
246 LL | const NESTED_STR_MUCH_TOO_LONG: (&str,) = (unsafe { mem::transmute((&42, usize::MAX)) },);
247 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered invalid reference metadata: slice is bigger than largest supported object
249 = 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.
250 = note: the raw bytes of the constant (size: 16, align: 8) {
251 ╾ALLOC_ID╼ ff ff ff ff ff ff ff ff │ ╾──────╼........
254 error[E0080]: it is undefined behavior to use this value
255 --> $DIR/raw-bytes.rs:141:1
257 LL | const MY_STR_MUCH_TOO_LONG: &MyStr = unsafe { mem::transmute((&42u8, usize::MAX)) };
258 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered invalid reference metadata: slice is bigger than largest supported object
260 = 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.
261 = note: the raw bytes of the constant (size: 16, align: 8) {
262 ╾ALLOC_ID╼ ff ff ff ff ff ff ff ff │ ╾──────╼........
265 error[E0080]: it is undefined behavior to use this value
266 --> $DIR/raw-bytes.rs:144:1
268 LL | const STR_NO_INIT: &str = unsafe { mem::transmute::<&[_], _>(&[MaybeUninit::<u8> { uninit: () }]) };
269 | ^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>: encountered uninitialized data in `str`
271 = 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.
272 = note: the raw bytes of the constant (size: 16, align: 8) {
273 ╾ALLOC_ID╼ 01 00 00 00 00 00 00 00 │ ╾──────╼........
276 error[E0080]: it is undefined behavior to use this value
277 --> $DIR/raw-bytes.rs:146:1
279 LL | const MYSTR_NO_INIT: &MyStr = unsafe { mem::transmute::<&[_], _>(&[MaybeUninit::<u8> { uninit: () }]) };
280 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>.0: encountered uninitialized data in `str`
282 = 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.
283 = note: the raw bytes of the constant (size: 16, align: 8) {
284 ╾ALLOC_ID╼ 01 00 00 00 00 00 00 00 │ ╾──────╼........
287 error[E0080]: it is undefined behavior to use this value
288 --> $DIR/raw-bytes.rs:148:1
290 LL | const MYSTR_NO_INIT_ISSUE83182: &MyStr = unsafe { mem::transmute::<&[_], _>(&[&()]) };
291 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
293 = help: this code performed an operation that depends on the underlying bytes representing a pointer
294 = help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
295 = note: the raw bytes of the constant (size: 16, align: 8) {
296 ╾ALLOC_ID╼ 01 00 00 00 00 00 00 00 │ ╾──────╼........
299 error[E0080]: it is undefined behavior to use this value
300 --> $DIR/raw-bytes.rs:152:1
302 LL | const SLICE_TOO_LONG: &[u8] = unsafe { mem::transmute((&42u8, 999usize)) };
303 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a dangling reference (going beyond the bounds of its allocation)
305 = 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.
306 = note: the raw bytes of the constant (size: 16, align: 8) {
307 ╾ALLOC_ID╼ e7 03 00 00 00 00 00 00 │ ╾──────╼........
310 error[E0080]: it is undefined behavior to use this value
311 --> $DIR/raw-bytes.rs:154:1
313 LL | const SLICE_TOO_LONG_OVERFLOW: &[u32] = unsafe { mem::transmute((&42u32, isize::MAX)) };
314 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered invalid reference metadata: slice is bigger than largest supported object
316 = 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.
317 = note: the raw bytes of the constant (size: 16, align: 8) {
318 ╾ALLOC_ID╼ ff ff ff ff ff ff ff 7f │ ╾──────╼........
321 error[E0080]: it is undefined behavior to use this value
322 --> $DIR/raw-bytes.rs:157:1
324 LL | const SLICE_TOO_LONG_BOX: Box<[u8]> = unsafe { mem::transmute((&42u8, 999usize)) };
325 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a dangling box (going beyond the bounds of its allocation)
327 = 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.
328 = note: the raw bytes of the constant (size: 16, align: 8) {
329 ╾ALLOC_ID╼ e7 03 00 00 00 00 00 00 │ ╾──────╼........
332 error[E0080]: it is undefined behavior to use this value
333 --> $DIR/raw-bytes.rs:160:1
335 LL | const SLICE_CONTENT_INVALID: &[bool] = &[unsafe { mem::transmute(3u8) }];
336 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>[0]: encountered 0x03, but expected a boolean
338 = 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.
339 = note: the raw bytes of the constant (size: 8, align: 8) {
340 ╾ALLOC_ID╼ │ ╾──────╼
343 note: erroneous constant used
344 --> $DIR/raw-bytes.rs:160:40
346 LL | const SLICE_CONTENT_INVALID: &[bool] = &[unsafe { mem::transmute(3u8) }];
347 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
349 error[E0080]: it is undefined behavior to use this value
350 --> $DIR/raw-bytes.rs:166:1
352 LL | const MYSLICE_PREFIX_BAD: &MySliceBool = &MySlice(unsafe { mem::transmute(3u8) }, [false]);
353 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>.0: encountered 0x03, but expected a boolean
355 = 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.
356 = note: the raw bytes of the constant (size: 8, align: 8) {
357 ╾ALLOC_ID╼ │ ╾──────╼
360 note: erroneous constant used
361 --> $DIR/raw-bytes.rs:166:42
363 LL | const MYSLICE_PREFIX_BAD: &MySliceBool = &MySlice(unsafe { mem::transmute(3u8) }, [false]);
364 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
366 error[E0080]: it is undefined behavior to use this value
367 --> $DIR/raw-bytes.rs:170:1
369 LL | const MYSLICE_SUFFIX_BAD: &MySliceBool = &MySlice(true, [unsafe { mem::transmute(3u8) }]);
370 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>.1[0]: encountered 0x03, but expected a boolean
372 = 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.
373 = note: the raw bytes of the constant (size: 8, align: 8) {
374 ╾ALLOC_ID╼ │ ╾──────╼
377 note: erroneous constant used
378 --> $DIR/raw-bytes.rs:170:42
380 LL | const MYSLICE_SUFFIX_BAD: &MySliceBool = &MySlice(true, [unsafe { mem::transmute(3u8) }]);
381 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
383 error[E0080]: it is undefined behavior to use this value
384 --> $DIR/raw-bytes.rs:175:1
386 LL | const TRAIT_OBJ_SHORT_VTABLE_1: W<&dyn Trait> = unsafe { mem::transmute(W((&92u8, &3u8))) };
387 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered allocN, but expected a vtable pointer
389 = 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.
390 = note: the raw bytes of the constant (size: 16, align: 8) {
391 ╾ALLOC_ID╼ ╾ALLOC_ID╼ │ ╾──────╼╾──────╼
394 error[E0080]: it is undefined behavior to use this value
395 --> $DIR/raw-bytes.rs:179:1
397 LL | const TRAIT_OBJ_SHORT_VTABLE_2: W<&dyn Trait> = unsafe { mem::transmute(W((&92u8, &3u64))) };
398 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered allocN, but expected a vtable pointer
400 = 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.
401 = note: the raw bytes of the constant (size: 16, align: 8) {
402 ╾ALLOC_ID╼ ╾ALLOC_ID╼ │ ╾──────╼╾──────╼
405 error[E0080]: it is undefined behavior to use this value
406 --> $DIR/raw-bytes.rs:183:1
408 LL | const TRAIT_OBJ_INT_VTABLE: W<&dyn Trait> = unsafe { mem::transmute(W((&92u8, 4usize))) };
409 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered 0x4[noalloc], but expected a vtable pointer
411 = 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.
412 = note: the raw bytes of the constant (size: 16, align: 8) {
413 ╾ALLOC_ID╼ 04 00 00 00 00 00 00 00 │ ╾──────╼........
416 error[E0080]: it is undefined behavior to use this value
417 --> $DIR/raw-bytes.rs:186:1
419 LL | const TRAIT_OBJ_BAD_DROP_FN_NOT_FN_PTR: W<&dyn Trait> = unsafe { mem::transmute(W((&92u8, &[&42u8; 8]))) };
420 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered allocN, but expected a vtable pointer
422 = 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.
423 = note: the raw bytes of the constant (size: 16, align: 8) {
424 ╾ALLOC_ID╼ ╾ALLOC_ID╼ │ ╾──────╼╾──────╼
427 error[E0080]: it is undefined behavior to use this value
428 --> $DIR/raw-bytes.rs:190:1
430 LL | const TRAIT_OBJ_CONTENT_INVALID: &dyn Trait = unsafe { mem::transmute::<_, &bool>(&3u8) };
431 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>.<dyn-downcast>: encountered 0x03, but expected a boolean
433 = 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.
434 = note: the raw bytes of the constant (size: 16, align: 8) {
435 ╾ALLOC_ID╼ ╾ALLOC_ID╼ │ ╾──────╼╾──────╼
438 error[E0080]: it is undefined behavior to use this value
439 --> $DIR/raw-bytes.rs:194:1
441 LL | const RAW_TRAIT_OBJ_VTABLE_NULL: *const dyn Trait = unsafe { mem::transmute((&92u8, 0usize)) };
442 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered null pointer, but expected a vtable pointer
444 = 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.
445 = note: the raw bytes of the constant (size: 16, align: 8) {
446 ╾ALLOC_ID╼ 00 00 00 00 00 00 00 00 │ ╾──────╼........
449 error[E0080]: it is undefined behavior to use this value
450 --> $DIR/raw-bytes.rs:196:1
452 LL | const RAW_TRAIT_OBJ_VTABLE_INVALID: *const dyn Trait = unsafe { mem::transmute((&92u8, &3u64)) };
453 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered allocN, but expected a vtable pointer
455 = 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.
456 = note: the raw bytes of the constant (size: 16, align: 8) {
457 ╾ALLOC_ID╼ ╾ALLOC_ID╼ │ ╾──────╼╾──────╼
460 error[E0080]: it is undefined behavior to use this value
461 --> $DIR/raw-bytes.rs:201:1
463 LL | const LAYOUT_INVALID_ZERO: Layout = unsafe { Layout::from_size_align_unchecked(0x1000, 0x00) };
464 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .align.0.<enum-tag>: encountered 0x0000000000000000, but expected a valid enum tag
466 = 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.
467 = note: the raw bytes of the constant (size: 16, align: 8) {
468 00 10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 │ ................
471 error[E0080]: it is undefined behavior to use this value
472 --> $DIR/raw-bytes.rs:205:1
474 LL | const LAYOUT_INVALID_THREE: Layout = unsafe { Layout::from_size_align_unchecked(9, 3) };
475 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .align.0.<enum-tag>: encountered 0x0000000000000003, but expected a valid enum tag
477 = 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.
478 = note: the raw bytes of the constant (size: 16, align: 8) {
479 09 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 │ ................
482 error[E0080]: it is undefined behavior to use this value
483 --> $DIR/raw-bytes.rs:209:1
485 LL | const _: &[!; 1] = unsafe { &*(1_usize as *const [!; 1]) };
486 | ^^^^^^^^^^^^^^^^ constructing invalid value: encountered a reference pointing to uninhabited type [!; 1]
488 = 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.
489 = note: the raw bytes of the constant (size: 8, align: 8) {
490 01 00 00 00 00 00 00 00 │ ........
493 error[E0080]: it is undefined behavior to use this value
494 --> $DIR/raw-bytes.rs:210:1
496 LL | const _: &[!] = unsafe { &*(1_usize as *const [!; 1]) };
497 | ^^^^^^^^^^^^^ constructing invalid value at .<deref>[0]: encountered a value of the never type `!`
499 = 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.
500 = note: the raw bytes of the constant (size: 16, align: 8) {
501 01 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 │ ................
504 error[E0080]: it is undefined behavior to use this value
505 --> $DIR/raw-bytes.rs:211:1
507 LL | const _: &[!] = unsafe { &*(1_usize as *const [!; 42]) };
508 | ^^^^^^^^^^^^^ constructing invalid value at .<deref>[0]: encountered a value of the never type `!`
510 = 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.
511 = note: the raw bytes of the constant (size: 16, align: 8) {
512 01 00 00 00 00 00 00 00 2a 00 00 00 00 00 00 00 │ ........*.......
515 error[E0080]: it is undefined behavior to use this value
516 --> $DIR/raw-bytes.rs:215:1
518 LL | pub static S4: &[u8] = unsafe { from_raw_parts((&D1) as *const _ as _, 1) };
519 | ^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>[0]: encountered uninitialized bytes
521 = 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.
522 = note: the raw bytes of the constant (size: 16, align: 8) {
523 ╾ALLOC_ID╼ 01 00 00 00 00 00 00 00 │ ╾──────╼........
526 error[E0080]: it is undefined behavior to use this value
527 --> $DIR/raw-bytes.rs:218:1
529 LL | pub static S5: &[u8] = unsafe { from_raw_parts((&D3) as *const _ as _, mem::size_of::<&u32>()) };
530 | ^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
532 = help: this code performed an operation that depends on the underlying bytes representing a pointer
533 = help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
534 = note: the raw bytes of the constant (size: 16, align: 8) {
535 ╾ALLOC_ID╼ 08 00 00 00 00 00 00 00 │ ╾──────╼........
538 error[E0080]: it is undefined behavior to use this value
539 --> $DIR/raw-bytes.rs:221:1
541 LL | pub static S6: &[bool] = unsafe { from_raw_parts((&D0) as *const _ as _, 4) };
542 | ^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>[0]: encountered 0x11, but expected a boolean
544 = 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.
545 = note: the raw bytes of the constant (size: 16, align: 8) {
546 ╾ALLOC_ID╼ 04 00 00 00 00 00 00 00 │ ╾──────╼........
549 error[E0080]: it is undefined behavior to use this value
550 --> $DIR/raw-bytes.rs:225:1
552 LL | pub static S7: &[u16] = unsafe {
553 | ^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>[1]: encountered uninitialized bytes
555 = 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.
556 = note: the raw bytes of the constant (size: 16, align: 8) {
557 ╾ALLOC_ID+0x2╼ 04 00 00 00 00 00 00 00 │ ╾──────╼........
560 error[E0080]: it is undefined behavior to use this value
561 --> $DIR/raw-bytes.rs:232:1
563 LL | pub static R4: &[u8] = unsafe {
564 | ^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>[0]: encountered uninitialized bytes
566 = 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.
567 = note: the raw bytes of the constant (size: 16, align: 8) {
568 ╾ALLOC_ID╼ 01 00 00 00 00 00 00 00 │ ╾──────╼........
571 error[E0080]: it is undefined behavior to use this value
572 --> $DIR/raw-bytes.rs:237:1
574 LL | pub static R5: &[u8] = unsafe {
575 | ^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
577 = help: this code performed an operation that depends on the underlying bytes representing a pointer
578 = help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
579 = note: the raw bytes of the constant (size: 16, align: 8) {
580 ╾ALLOC_ID╼ 08 00 00 00 00 00 00 00 │ ╾──────╼........
583 error[E0080]: it is undefined behavior to use this value
584 --> $DIR/raw-bytes.rs:242:1
586 LL | pub static R6: &[bool] = unsafe {
587 | ^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>[0]: encountered 0x11, but expected a boolean
589 = 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.
590 = note: the raw bytes of the constant (size: 16, align: 8) {
591 ╾ALLOC_ID╼ 04 00 00 00 00 00 00 00 │ ╾──────╼........
594 error: aborting due to 52 previous errors
596 For more information about this error, try `rustc --explain E0080`.