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