|
| 1 | +error: any use of this value will cause an error |
| 2 | + --> $SRC_DIR/core/src/intrinsics.rs:LL:COL |
| 3 | + | |
| 4 | +LL | unsafe { copy_nonoverlapping(src, dst, count) } |
| 5 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 6 | + | | |
| 7 | + | memory access failed: pointer must be in-bounds at offset 40, but is outside bounds of alloc4 which has size 4 |
| 8 | + | inside `copy_nonoverlapping::<i32>` at $SRC_DIR/core/src/intrinsics.rs:LL:COL |
| 9 | + | inside `COPY_OOB_1` at $DIR/copy-intrinsic.rs:16:5 |
| 10 | + | |
| 11 | + ::: $DIR/copy-intrinsic.rs:12:1 |
| 12 | + | |
| 13 | +LL | / const COPY_OOB_1: () = unsafe { |
| 14 | +LL | | let mut x = 0i32; |
| 15 | +LL | | let dangle = (&mut x as *mut i32).wrapping_add(10); |
| 16 | +LL | | // Even if the first ptr is an int ptr and this is a ZST copy, we should detect dangling 2nd ptrs. |
| 17 | +... | |
| 18 | +LL | | |
| 19 | +LL | | }; |
| 20 | + | |__- |
| 21 | + | |
| 22 | + = note: `#[deny(const_err)]` on by default |
| 23 | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! |
| 24 | + = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800> |
| 25 | + |
| 26 | +error: any use of this value will cause an error |
| 27 | + --> $SRC_DIR/core/src/intrinsics.rs:LL:COL |
| 28 | + | |
| 29 | +LL | unsafe { copy_nonoverlapping(src, dst, count) } |
| 30 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 31 | + | | |
| 32 | + | memory access failed: pointer must be in-bounds at offset 40, but is outside bounds of alloc6 which has size 4 |
| 33 | + | inside `copy_nonoverlapping::<i32>` at $SRC_DIR/core/src/intrinsics.rs:LL:COL |
| 34 | + | inside `COPY_OOB_2` at $DIR/copy-intrinsic.rs:24:5 |
| 35 | + | |
| 36 | + ::: $DIR/copy-intrinsic.rs:20:1 |
| 37 | + | |
| 38 | +LL | / const COPY_OOB_2: () = unsafe { |
| 39 | +LL | | let x = 0i32; |
| 40 | +LL | | let dangle = (&x as *const i32).wrapping_add(10); |
| 41 | +LL | | // Even if the second ptr is an int ptr and this is a ZST copy, we should detect dangling 1st ptrs. |
| 42 | +... | |
| 43 | +LL | | |
| 44 | +LL | | }; |
| 45 | + | |__- |
| 46 | + | |
| 47 | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! |
| 48 | + = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800> |
| 49 | + |
| 50 | +error: any use of this value will cause an error |
| 51 | + --> $SRC_DIR/core/src/intrinsics.rs:LL:COL |
| 52 | + | |
| 53 | +LL | unsafe { copy(src, dst, count) } |
| 54 | + | ^^^^^^^^^^^^^^^^^^^^^ |
| 55 | + | | |
| 56 | + | overflow computing total size of `copy` |
| 57 | + | inside `std::intrinsics::copy::<i32>` at $SRC_DIR/core/src/intrinsics.rs:LL:COL |
| 58 | + | inside `COPY_SIZE_OVERFLOW` at $DIR/copy-intrinsic.rs:32:5 |
| 59 | + | |
| 60 | + ::: $DIR/copy-intrinsic.rs:29:1 |
| 61 | + | |
| 62 | +LL | / const COPY_SIZE_OVERFLOW: () = unsafe { |
| 63 | +LL | | let x = 0; |
| 64 | +LL | | let mut y = 0; |
| 65 | +LL | | ptr::copy(&x, &mut y, 1usize << (mem::size_of::<usize>() * 8 - 1)); |
| 66 | +LL | | |
| 67 | +LL | | |
| 68 | +LL | | }; |
| 69 | + | |__- |
| 70 | + | |
| 71 | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! |
| 72 | + = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800> |
| 73 | + |
| 74 | +error: any use of this value will cause an error |
| 75 | + --> $SRC_DIR/core/src/intrinsics.rs:LL:COL |
| 76 | + | |
| 77 | +LL | unsafe { copy_nonoverlapping(src, dst, count) } |
| 78 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 79 | + | | |
| 80 | + | overflow computing total size of `copy_nonoverlapping` |
| 81 | + | inside `copy_nonoverlapping::<i32>` at $SRC_DIR/core/src/intrinsics.rs:LL:COL |
| 82 | + | inside `COPY_NONOVERLAPPING_SIZE_OVERFLOW` at $DIR/copy-intrinsic.rs:39:5 |
| 83 | + | |
| 84 | + ::: $DIR/copy-intrinsic.rs:36:1 |
| 85 | + | |
| 86 | +LL | / const COPY_NONOVERLAPPING_SIZE_OVERFLOW: () = unsafe { |
| 87 | +LL | | let x = 0; |
| 88 | +LL | | let mut y = 0; |
| 89 | +LL | | ptr::copy_nonoverlapping(&x, &mut y, 1usize << (mem::size_of::<usize>() * 8 - 1)); |
| 90 | +LL | | |
| 91 | +LL | | |
| 92 | +LL | | }; |
| 93 | + | |__- |
| 94 | + | |
| 95 | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! |
| 96 | + = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800> |
| 97 | + |
| 98 | +error: aborting due to 4 previous errors |
| 99 | + |
0 commit comments