1 error: any use of this value will cause an error
2 --> $DIR/copy-intrinsic.rs:16:5
4 LL | / const COPY_OOB_1: () = unsafe {
5 LL | | let mut x = 0i32;
6 LL | | let dangle = (&mut x as *mut i32).wrapping_add(10);
7 LL | | // Even if the first ptr is an int ptr and this is a ZST copy, we should detect dangling 2nd ptrs.
8 LL | | ptr::copy_nonoverlapping(0x100 as *const i32, dangle, 0);
9 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ memory access failed: pointer must be in-bounds at offset 40, but is outside bounds of alloc4 which has size 4
15 = note: `#[deny(const_err)]` on by default
16 = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
17 = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
19 error: any use of this value will cause an error
20 --> $DIR/copy-intrinsic.rs:24:5
22 LL | / const COPY_OOB_2: () = unsafe {
24 LL | | let dangle = (&x as *const i32).wrapping_add(10);
25 LL | | // Even if the second ptr is an int ptr and this is a ZST copy, we should detect dangling 1st ptrs.
26 LL | | ptr::copy_nonoverlapping(dangle, 0x100 as *mut i32, 0);
27 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ memory access failed: pointer must be in-bounds at offset 40, but is outside bounds of alloc6 which has size 4
33 = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
34 = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
36 error: any use of this value will cause an error
37 --> $DIR/copy-intrinsic.rs:32:5
39 LL | / const COPY_SIZE_OVERFLOW: () = unsafe {
42 LL | | ptr::copy(&x, &mut y, 1usize << (mem::size_of::<usize>() * 8 - 1));
43 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ overflow computing total size of `copy`
49 = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
50 = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
52 error: any use of this value will cause an error
53 --> $DIR/copy-intrinsic.rs:39:5
55 LL | / const COPY_NONOVERLAPPING_SIZE_OVERFLOW: () = unsafe {
58 LL | | ptr::copy_nonoverlapping(&x, &mut y, 1usize << (mem::size_of::<usize>() * 8 - 1));
59 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ overflow computing total size of `copy_nonoverlapping`
65 = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
66 = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
68 error: aborting due to 4 previous errors