]> git.lizzy.rs Git - rust.git/blob - src/test/ui/consts/const-eval/ub-wide-ptr.64bit.stderr
make use of symbolic vtables in interpreter
[rust.git] / src / test / ui / consts / const-eval / ub-wide-ptr.64bit.stderr
1 error[E0080]: it is undefined behavior to use this value
2   --> $DIR/ub-wide-ptr.rs:37:1
3    |
4 LL | const STR_TOO_LONG: &str = unsafe { mem::transmute((&42u8, 999usize)) };
5    | ^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a dangling reference (going beyond the bounds of its allocation)
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: 16, align: 8) {
9                ╾───────allocN────────╼ e7 03 00 00 00 00 00 00 │ ╾──────╼........
10            }
11
12 error[E0080]: it is undefined behavior to use this value
13   --> $DIR/ub-wide-ptr.rs:39:1
14    |
15 LL | const NESTED_STR_MUCH_TOO_LONG: (&str,) = (unsafe { mem::transmute((&42, usize::MAX)) },);
16    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered invalid reference metadata: slice is bigger than largest supported object
17    |
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: 16, align: 8) {
20                ╾───────allocN───────╼ ff ff ff ff ff ff ff ff │ ╾──────╼........
21            }
22
23 error: any use of this value will cause an error
24   --> $DIR/ub-wide-ptr.rs:42:1
25    |
26 LL | const STR_LENGTH_PTR: &str = unsafe { mem::transmute((&42u8, &3)) };
27    | ^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
28    |
29    = note: `#[deny(const_err)]` on by default
30    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
31    = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
32
33 error: any use of this value will cause an error
34   --> $DIR/ub-wide-ptr.rs:46:1
35    |
36 LL | const MY_STR_LENGTH_PTR: &MyStr = unsafe { mem::transmute((&42u8, &3)) };
37    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
38    |
39    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
40    = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
41
42 error[E0080]: it is undefined behavior to use this value
43   --> $DIR/ub-wide-ptr.rs:49:1
44    |
45 LL | const MY_STR_MUCH_TOO_LONG: &MyStr = unsafe { mem::transmute((&42u8, usize::MAX)) };
46    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered invalid reference metadata: slice is bigger than largest supported object
47    |
48    = 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.
49    = note: the raw bytes of the constant (size: 16, align: 8) {
50                ╾───────allocN───────╼ ff ff ff ff ff ff ff ff │ ╾──────╼........
51            }
52
53 error[E0080]: it is undefined behavior to use this value
54   --> $DIR/ub-wide-ptr.rs:53:1
55    |
56 LL | const STR_NO_INIT: &str = unsafe { mem::transmute::<&[_], _>(&[MaybeUninit::<u8> { uninit: () }]) };
57    | ^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>: encountered uninitialized data in `str`
58    |
59    = 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.
60    = note: the raw bytes of the constant (size: 16, align: 8) {
61                ╾───────allocN───────╼ 01 00 00 00 00 00 00 00 │ ╾──────╼........
62            }
63
64 error[E0080]: it is undefined behavior to use this value
65   --> $DIR/ub-wide-ptr.rs:56:1
66    |
67 LL | const MYSTR_NO_INIT: &MyStr = unsafe { mem::transmute::<&[_], _>(&[MaybeUninit::<u8> { uninit: () }]) };
68    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>.0: encountered uninitialized data in `str`
69    |
70    = 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.
71    = note: the raw bytes of the constant (size: 16, align: 8) {
72                ╾───────allocN───────╼ 01 00 00 00 00 00 00 00 │ ╾──────╼........
73            }
74
75 error[E0080]: it is undefined behavior to use this value
76   --> $DIR/ub-wide-ptr.rs:63:1
77    |
78 LL | const SLICE_LENGTH_UNINIT: &[u8] = unsafe {
79    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered uninitialized reference
80    |
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 rustc repository if you believe it should not be considered undefined behavior.
82    = note: the raw bytes of the constant (size: 16, align: 8) {
83                __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ │ ░░░░░░░░░░░░░░░░
84            }
85
86 error[E0080]: it is undefined behavior to use this value
87   --> $DIR/ub-wide-ptr.rs:69:1
88    |
89 LL | const SLICE_TOO_LONG: &[u8] = unsafe { mem::transmute((&42u8, 999usize)) };
90    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a dangling reference (going beyond the bounds of its allocation)
91    |
92    = 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.
93    = note: the raw bytes of the constant (size: 16, align: 8) {
94                ╾───────allocN───────╼ e7 03 00 00 00 00 00 00 │ ╾──────╼........
95            }
96
97 error[E0080]: it is undefined behavior to use this value
98   --> $DIR/ub-wide-ptr.rs:72:1
99    |
100 LL | const SLICE_TOO_LONG_OVERFLOW: &[u32] = unsafe { mem::transmute((&42u32, isize::MAX)) };
101    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered invalid reference metadata: slice is bigger than largest supported object
102    |
103    = 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.
104    = note: the raw bytes of the constant (size: 16, align: 8) {
105                ╾───────allocN───────╼ ff ff ff ff ff ff ff 7f │ ╾──────╼........
106            }
107
108 error: any use of this value will cause an error
109   --> $DIR/ub-wide-ptr.rs:75:1
110    |
111 LL | const SLICE_LENGTH_PTR: &[u8] = unsafe { mem::transmute((&42u8, &3)) };
112    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
113    |
114    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
115    = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
116
117 error[E0080]: it is undefined behavior to use this value
118   --> $DIR/ub-wide-ptr.rs:79:1
119    |
120 LL | const SLICE_TOO_LONG_BOX: Box<[u8]> = unsafe { mem::transmute((&42u8, 999usize)) };
121    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a dangling box (going beyond the bounds of its allocation)
122    |
123    = 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.
124    = note: the raw bytes of the constant (size: 16, align: 8) {
125                ╾───────allocN───────╼ e7 03 00 00 00 00 00 00 │ ╾──────╼........
126            }
127
128 error: any use of this value will cause an error
129   --> $DIR/ub-wide-ptr.rs:82:1
130    |
131 LL | const SLICE_LENGTH_PTR_BOX: Box<[u8]> = unsafe { mem::transmute((&42u8, &3)) };
132    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
133    |
134    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
135    = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
136
137 error[E0080]: it is undefined behavior to use this value
138   --> $DIR/ub-wide-ptr.rs:87:1
139    |
140 LL | const SLICE_CONTENT_INVALID: &[bool] = &[unsafe { mem::transmute(3u8) }];
141    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>[0]: encountered 0x03, but expected a boolean
142    |
143    = 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.
144    = note: the raw bytes of the constant (size: 8, align: 8) {
145                ╾───────allocN───────╼                         │ ╾──────╼
146            }
147
148 error: any use of this value will cause an error
149   --> $DIR/ub-wide-ptr.rs:87:40
150    |
151 LL | const SLICE_CONTENT_INVALID: &[bool] = &[unsafe { mem::transmute(3u8) }];
152    | ------------------------------------   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ referenced constant has errors
153    |
154    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
155    = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
156
157 error[E0080]: it is undefined behavior to use this value
158   --> $DIR/ub-wide-ptr.rs:95:1
159    |
160 LL | const MYSLICE_PREFIX_BAD: &MySliceBool = &MySlice(unsafe { mem::transmute(3u8) }, [false]);
161    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>.0: encountered 0x03, but expected a boolean
162    |
163    = 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.
164    = note: the raw bytes of the constant (size: 8, align: 8) {
165                ╾──────allocN───────╼                         │ ╾──────╼
166            }
167
168 error: any use of this value will cause an error
169   --> $DIR/ub-wide-ptr.rs:95:42
170    |
171 LL | const MYSLICE_PREFIX_BAD: &MySliceBool = &MySlice(unsafe { mem::transmute(3u8) }, [false]);
172    | --------------------------------------   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ referenced constant has errors
173    |
174    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
175    = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
176
177 error[E0080]: it is undefined behavior to use this value
178   --> $DIR/ub-wide-ptr.rs:100:1
179    |
180 LL | const MYSLICE_SUFFIX_BAD: &MySliceBool = &MySlice(true, [unsafe { mem::transmute(3u8) }]);
181    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>.1[0]: encountered 0x03, but expected a boolean
182    |
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                ╾──────allocN───────╼                         │ ╾──────╼
186            }
187
188 error: any use of this value will cause an error
189   --> $DIR/ub-wide-ptr.rs:100:42
190    |
191 LL | const MYSLICE_SUFFIX_BAD: &MySliceBool = &MySlice(true, [unsafe { mem::transmute(3u8) }]);
192    | --------------------------------------   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ referenced constant has errors
193    |
194    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
195    = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
196
197 error[E0080]: it is undefined behavior to use this value
198   --> $DIR/ub-wide-ptr.rs:109:1
199    |
200 LL | const RAW_SLICE_LENGTH_UNINIT: *const [u8] = unsafe {
201    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered uninitialized raw pointer
202    |
203    = 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.
204    = note: the raw bytes of the constant (size: 16, align: 8) {
205                __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ │ ░░░░░░░░░░░░░░░░
206            }
207
208 error[E0080]: it is undefined behavior to use this value
209   --> $DIR/ub-wide-ptr.rs:117:1
210    |
211 LL | const TRAIT_OBJ_SHORT_VTABLE_1: W<&dyn Trait> = unsafe { mem::transmute(W((&92u8, &3u8))) };
212    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered allocN, but expected a vtable pointer
213    |
214    = 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.
215    = note: the raw bytes of the constant (size: 16, align: 8) {
216                ╾──────allocN───────╼ ╾──────allocN───────╼ │ ╾──────╼╾──────╼
217            }
218
219 error[E0080]: it is undefined behavior to use this value
220   --> $DIR/ub-wide-ptr.rs:120:1
221    |
222 LL | const TRAIT_OBJ_SHORT_VTABLE_2: W<&dyn Trait> = unsafe { mem::transmute(W((&92u8, &3u64))) };
223    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered allocN, but expected a vtable pointer
224    |
225    = 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.
226    = note: the raw bytes of the constant (size: 16, align: 8) {
227                ╾──────allocN───────╼ ╾──────allocN───────╼ │ ╾──────╼╾──────╼
228            }
229
230 error[E0080]: it is undefined behavior to use this value
231   --> $DIR/ub-wide-ptr.rs:123:1
232    |
233 LL | const TRAIT_OBJ_INT_VTABLE: W<&dyn Trait> = unsafe { mem::transmute(W((&92u8, 4usize))) };
234    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered 0x4[noalloc], but expected a vtable pointer
235    |
236    = 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.
237    = note: the raw bytes of the constant (size: 16, align: 8) {
238                ╾──────allocN───────╼ 04 00 00 00 00 00 00 00 │ ╾──────╼........
239            }
240
241 error[E0080]: evaluation of constant value failed
242   --> $DIR/ub-wide-ptr.rs:125:57
243    |
244 LL | const TRAIT_OBJ_UNALIGNED_VTABLE: &dyn Trait = unsafe { mem::transmute((&92u8, &[0u8; 128])) };
245    |                                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ using allocN as vtable pointer but it does not point to a vtable
246
247 error[E0080]: evaluation of constant value failed
248   --> $DIR/ub-wide-ptr.rs:128:57
249    |
250 LL | const TRAIT_OBJ_BAD_DROP_FN_NULL: &dyn Trait = unsafe { mem::transmute((&92u8, &[0usize; 8])) };
251    |                                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ using allocN as vtable pointer but it does not point to a vtable
252
253 error[E0080]: evaluation of constant value failed
254   --> $DIR/ub-wide-ptr.rs:131:56
255    |
256 LL | const TRAIT_OBJ_BAD_DROP_FN_INT: &dyn Trait = unsafe { mem::transmute((&92u8, &[1usize; 8])) };
257    |                                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ using allocN as vtable pointer but it does not point to a vtable
258
259 error[E0080]: it is undefined behavior to use this value
260   --> $DIR/ub-wide-ptr.rs:134:1
261    |
262 LL | const TRAIT_OBJ_BAD_DROP_FN_NOT_FN_PTR: W<&dyn Trait> = unsafe { mem::transmute(W((&92u8, &[&42u8; 8]))) };
263    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered allocN, but expected a vtable pointer
264    |
265    = 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.
266    = note: the raw bytes of the constant (size: 16, align: 8) {
267                ╾──────allocN───────╼ ╾──────allocN───────╼ │ ╾──────╼╾──────╼
268            }
269
270 error[E0080]: it is undefined behavior to use this value
271   --> $DIR/ub-wide-ptr.rs:138:1
272    |
273 LL | const TRAIT_OBJ_CONTENT_INVALID: &dyn Trait = unsafe { mem::transmute::<_, &bool>(&3u8) };
274    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>.<dyn-downcast>: encountered 0x03, but expected a boolean
275    |
276    = 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.
277    = note: the raw bytes of the constant (size: 16, align: 8) {
278                ╾──────allocN───────╼ ╾──────allocN───────╼ │ ╾──────╼╾──────╼
279            }
280
281 error[E0080]: it is undefined behavior to use this value
282   --> $DIR/ub-wide-ptr.rs:142:1
283    |
284 LL | const RAW_TRAIT_OBJ_VTABLE_NULL: *const dyn Trait = unsafe { mem::transmute((&92u8, 0usize)) };
285    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered null pointer, but expected a vtable pointer
286    |
287    = 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.
288    = note: the raw bytes of the constant (size: 16, align: 8) {
289                ╾──────allocN───────╼ 00 00 00 00 00 00 00 00 │ ╾──────╼........
290            }
291
292 error[E0080]: it is undefined behavior to use this value
293   --> $DIR/ub-wide-ptr.rs:144:1
294    |
295 LL | const RAW_TRAIT_OBJ_VTABLE_INVALID: *const dyn Trait = unsafe { mem::transmute((&92u8, &3u64)) };
296    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered allocN, but expected a vtable pointer
297    |
298    = 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.
299    = note: the raw bytes of the constant (size: 16, align: 8) {
300                ╾──────allocN───────╼ ╾──────allocN───────╼ │ ╾──────╼╾──────╼
301            }
302
303 error[E0080]: could not evaluate static initializer
304   --> $DIR/ub-wide-ptr.rs:150:5
305    |
306 LL |     mem::transmute::<_, &dyn Trait>((&92u8, 0usize))
307    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ out-of-bounds pointer use: null pointer is a dangling pointer (it has no provenance)
308
309 error[E0080]: could not evaluate static initializer
310   --> $DIR/ub-wide-ptr.rs:154:5
311    |
312 LL |     mem::transmute::<_, &dyn Trait>((&92u8, &3u64))
313    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ using allocN as vtable pointer but it does not point to a vtable
314
315 error: aborting due to 32 previous errors
316
317 For more information about this error, try `rustc --explain E0080`.
318 Future incompatibility report: Future breakage diagnostic:
319 error: any use of this value will cause an error
320   --> $DIR/ub-wide-ptr.rs:42:1
321    |
322 LL | const STR_LENGTH_PTR: &str = unsafe { mem::transmute((&42u8, &3)) };
323    | ^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
324    |
325    = note: `#[deny(const_err)]` on by default
326    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
327    = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
328
329 Future breakage diagnostic:
330 error: any use of this value will cause an error
331   --> $DIR/ub-wide-ptr.rs:46:1
332    |
333 LL | const MY_STR_LENGTH_PTR: &MyStr = unsafe { mem::transmute((&42u8, &3)) };
334    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
335    |
336    = note: `#[deny(const_err)]` on by default
337    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
338    = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
339
340 Future breakage diagnostic:
341 error: any use of this value will cause an error
342   --> $DIR/ub-wide-ptr.rs:75:1
343    |
344 LL | const SLICE_LENGTH_PTR: &[u8] = unsafe { mem::transmute((&42u8, &3)) };
345    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
346    |
347    = note: `#[deny(const_err)]` on by default
348    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
349    = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
350
351 Future breakage diagnostic:
352 error: any use of this value will cause an error
353   --> $DIR/ub-wide-ptr.rs:82:1
354    |
355 LL | const SLICE_LENGTH_PTR_BOX: Box<[u8]> = unsafe { mem::transmute((&42u8, &3)) };
356    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
357    |
358    = note: `#[deny(const_err)]` on by default
359    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
360    = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
361
362 Future breakage diagnostic:
363 error: any use of this value will cause an error
364   --> $DIR/ub-wide-ptr.rs:87:40
365    |
366 LL | const SLICE_CONTENT_INVALID: &[bool] = &[unsafe { mem::transmute(3u8) }];
367    | ------------------------------------   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ referenced constant has errors
368    |
369    = note: `#[deny(const_err)]` on by default
370    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
371    = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
372
373 Future breakage diagnostic:
374 error: any use of this value will cause an error
375   --> $DIR/ub-wide-ptr.rs:95:42
376    |
377 LL | const MYSLICE_PREFIX_BAD: &MySliceBool = &MySlice(unsafe { mem::transmute(3u8) }, [false]);
378    | --------------------------------------   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ referenced constant has errors
379    |
380    = note: `#[deny(const_err)]` on by default
381    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
382    = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
383
384 Future breakage diagnostic:
385 error: any use of this value will cause an error
386   --> $DIR/ub-wide-ptr.rs:100:42
387    |
388 LL | const MYSLICE_SUFFIX_BAD: &MySliceBool = &MySlice(true, [unsafe { mem::transmute(3u8) }]);
389    | --------------------------------------   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ referenced constant has errors
390    |
391    = note: `#[deny(const_err)]` on by default
392    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
393    = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
394