1 error[E0080]: it is undefined behavior to use this value
2 --> $DIR/ub-wide-ptr.rs:37:1
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)
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 │ ╾──────╼........
12 error[E0080]: it is undefined behavior to use this value
13 --> $DIR/ub-wide-ptr.rs:39:1
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
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 │ ╾──────╼........
23 error: any use of this value will cause an error
24 --> $DIR/ub-wide-ptr.rs:42:1
26 LL | const STR_LENGTH_PTR: &str = unsafe { mem::transmute((&42u8, &3)) };
27 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
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>
33 error: any use of this value will cause an error
34 --> $DIR/ub-wide-ptr.rs:46:1
36 LL | const MY_STR_LENGTH_PTR: &MyStr = unsafe { mem::transmute((&42u8, &3)) };
37 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
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>
42 error[E0080]: it is undefined behavior to use this value
43 --> $DIR/ub-wide-ptr.rs:49:1
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
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 │ ╾──────╼........
53 error[E0080]: it is undefined behavior to use this value
54 --> $DIR/ub-wide-ptr.rs:53:1
56 LL | const STR_NO_INIT: &str = unsafe { mem::transmute::<&[_], _>(&[MaybeUninit::<u8> { uninit: () }]) };
57 | ^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>: encountered uninitialized data in `str`
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 │ ╾──────╼........
64 error[E0080]: it is undefined behavior to use this value
65 --> $DIR/ub-wide-ptr.rs:56:1
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`
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 │ ╾──────╼........
75 error[E0080]: it is undefined behavior to use this value
76 --> $DIR/ub-wide-ptr.rs:63:1
78 LL | const SLICE_LENGTH_UNINIT: &[u8] = unsafe {
79 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered uninitialized reference
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 __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ │ ░░░░░░░░░░░░░░░░
86 error[E0080]: it is undefined behavior to use this value
87 --> $DIR/ub-wide-ptr.rs:69:1
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)
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 │ ╾──────╼........
97 error[E0080]: it is undefined behavior to use this value
98 --> $DIR/ub-wide-ptr.rs:72:1
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
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 │ ╾──────╼........
108 error: any use of this value will cause an error
109 --> $DIR/ub-wide-ptr.rs:75:1
111 LL | const SLICE_LENGTH_PTR: &[u8] = unsafe { mem::transmute((&42u8, &3)) };
112 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
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>
117 error[E0080]: it is undefined behavior to use this value
118 --> $DIR/ub-wide-ptr.rs:79:1
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)
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 │ ╾──────╼........
128 error: any use of this value will cause an error
129 --> $DIR/ub-wide-ptr.rs:82:1
131 LL | const SLICE_LENGTH_PTR_BOX: Box<[u8]> = unsafe { mem::transmute((&42u8, &3)) };
132 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
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>
137 error[E0080]: it is undefined behavior to use this value
138 --> $DIR/ub-wide-ptr.rs:87:1
140 LL | const SLICE_CONTENT_INVALID: &[bool] = &[unsafe { mem::transmute(3u8) }];
141 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>[0]: encountered 0x03, but expected a boolean
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───────╼ │ ╾──────╼
148 error: any use of this value will cause an error
149 --> $DIR/ub-wide-ptr.rs:87:40
151 LL | const SLICE_CONTENT_INVALID: &[bool] = &[unsafe { mem::transmute(3u8) }];
152 | ------------------------------------ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ referenced constant has errors
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>
157 error[E0080]: it is undefined behavior to use this value
158 --> $DIR/ub-wide-ptr.rs:95:1
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
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───────╼ │ ╾──────╼
168 error: any use of this value will cause an error
169 --> $DIR/ub-wide-ptr.rs:95:42
171 LL | const MYSLICE_PREFIX_BAD: &MySliceBool = &MySlice(unsafe { mem::transmute(3u8) }, [false]);
172 | -------------------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ referenced constant has errors
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>
177 error[E0080]: it is undefined behavior to use this value
178 --> $DIR/ub-wide-ptr.rs:100:1
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
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───────╼ │ ╾──────╼
188 error: any use of this value will cause an error
189 --> $DIR/ub-wide-ptr.rs:100:42
191 LL | const MYSLICE_SUFFIX_BAD: &MySliceBool = &MySlice(true, [unsafe { mem::transmute(3u8) }]);
192 | -------------------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ referenced constant has errors
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>
197 error[E0080]: it is undefined behavior to use this value
198 --> $DIR/ub-wide-ptr.rs:109:1
200 LL | const RAW_SLICE_LENGTH_UNINIT: *const [u8] = unsafe {
201 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered uninitialized raw pointer
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 __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ │ ░░░░░░░░░░░░░░░░
208 error[E0080]: it is undefined behavior to use this value
209 --> $DIR/ub-wide-ptr.rs:117:1
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
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───────╼ │ ╾──────╼╾──────╼
219 error[E0080]: it is undefined behavior to use this value
220 --> $DIR/ub-wide-ptr.rs:120:1
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
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───────╼ │ ╾──────╼╾──────╼
230 error[E0080]: it is undefined behavior to use this value
231 --> $DIR/ub-wide-ptr.rs:123:1
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
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 │ ╾──────╼........
241 error[E0080]: evaluation of constant value failed
242 --> $DIR/ub-wide-ptr.rs:125:57
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
247 error[E0080]: evaluation of constant value failed
248 --> $DIR/ub-wide-ptr.rs:128:57
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
253 error[E0080]: evaluation of constant value failed
254 --> $DIR/ub-wide-ptr.rs:131:56
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
259 error[E0080]: it is undefined behavior to use this value
260 --> $DIR/ub-wide-ptr.rs:134:1
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
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───────╼ │ ╾──────╼╾──────╼
270 error[E0080]: it is undefined behavior to use this value
271 --> $DIR/ub-wide-ptr.rs:138:1
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
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───────╼ │ ╾──────╼╾──────╼
281 error[E0080]: it is undefined behavior to use this value
282 --> $DIR/ub-wide-ptr.rs:142:1
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
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 │ ╾──────╼........
292 error[E0080]: it is undefined behavior to use this value
293 --> $DIR/ub-wide-ptr.rs:144:1
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
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───────╼ │ ╾──────╼╾──────╼
303 error[E0080]: could not evaluate static initializer
304 --> $DIR/ub-wide-ptr.rs:150:5
306 LL | mem::transmute::<_, &dyn Trait>((&92u8, 0usize))
307 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ out-of-bounds pointer use: null pointer is a dangling pointer (it has no provenance)
309 error[E0080]: could not evaluate static initializer
310 --> $DIR/ub-wide-ptr.rs:154:5
312 LL | mem::transmute::<_, &dyn Trait>((&92u8, &3u64))
313 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ using allocN as vtable pointer but it does not point to a vtable
315 error: aborting due to 32 previous errors
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
322 LL | const STR_LENGTH_PTR: &str = unsafe { mem::transmute((&42u8, &3)) };
323 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
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>
329 Future breakage diagnostic:
330 error: any use of this value will cause an error
331 --> $DIR/ub-wide-ptr.rs:46:1
333 LL | const MY_STR_LENGTH_PTR: &MyStr = unsafe { mem::transmute((&42u8, &3)) };
334 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
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>
340 Future breakage diagnostic:
341 error: any use of this value will cause an error
342 --> $DIR/ub-wide-ptr.rs:75:1
344 LL | const SLICE_LENGTH_PTR: &[u8] = unsafe { mem::transmute((&42u8, &3)) };
345 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
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>
351 Future breakage diagnostic:
352 error: any use of this value will cause an error
353 --> $DIR/ub-wide-ptr.rs:82:1
355 LL | const SLICE_LENGTH_PTR_BOX: Box<[u8]> = unsafe { mem::transmute((&42u8, &3)) };
356 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
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>
362 Future breakage diagnostic:
363 error: any use of this value will cause an error
364 --> $DIR/ub-wide-ptr.rs:87:40
366 LL | const SLICE_CONTENT_INVALID: &[bool] = &[unsafe { mem::transmute(3u8) }];
367 | ------------------------------------ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ referenced constant has errors
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>
373 Future breakage diagnostic:
374 error: any use of this value will cause an error
375 --> $DIR/ub-wide-ptr.rs:95:42
377 LL | const MYSLICE_PREFIX_BAD: &MySliceBool = &MySlice(unsafe { mem::transmute(3u8) }, [false]);
378 | -------------------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ referenced constant has errors
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>
384 Future breakage diagnostic:
385 error: any use of this value will cause an error
386 --> $DIR/ub-wide-ptr.rs:100:42
388 LL | const MYSLICE_SUFFIX_BAD: &MySliceBool = &MySlice(true, [unsafe { mem::transmute(3u8) }]);
389 | -------------------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ referenced constant has errors
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>