|
| 1 | +error: any use of this value will cause an error |
| 2 | + --> $SRC_DIR/libcore/ptr/const_ptr.rs:LL:COL |
| 3 | + | |
| 4 | +LL | intrinsics::offset(self, count) |
| 5 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 6 | + | | |
| 7 | + | overflowing in-bounds pointer arithmetic |
| 8 | + | inside `std::ptr::const_ptr::<impl *const u8>::offset` at $SRC_DIR/libcore/ptr/const_ptr.rs:LL:COL |
| 9 | + | inside `BEFORE_START` at $DIR/offset_ub.rs:7:46 |
| 10 | + | |
| 11 | + ::: $DIR/offset_ub.rs:7:1 |
| 12 | + | |
| 13 | +LL | pub const BEFORE_START: *const u8 = unsafe { (&0u8 as *const u8).offset(-1) }; |
| 14 | + | ------------------------------------------------------------------------------ |
| 15 | + | |
| 16 | + = note: `#[deny(const_err)]` on by default |
| 17 | + |
| 18 | +error: any use of this value will cause an error |
| 19 | + --> $SRC_DIR/libcore/ptr/const_ptr.rs:LL:COL |
| 20 | + | |
| 21 | +LL | intrinsics::offset(self, count) |
| 22 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 23 | + | | |
| 24 | + | inbounds test failed: pointer must be in-bounds at offset 2, but is outside bounds of allocN which has size 1 |
| 25 | + | inside `std::ptr::const_ptr::<impl *const u8>::offset` at $SRC_DIR/libcore/ptr/const_ptr.rs:LL:COL |
| 26 | + | inside `AFTER_END` at $DIR/offset_ub.rs:8:43 |
| 27 | + | |
| 28 | + ::: $DIR/offset_ub.rs:8:1 |
| 29 | + | |
| 30 | +LL | pub const AFTER_END: *const u8 = unsafe { (&0u8 as *const u8).offset(2) }; |
| 31 | + | -------------------------------------------------------------------------- |
| 32 | + |
| 33 | +error: any use of this value will cause an error |
| 34 | + --> $SRC_DIR/libcore/ptr/const_ptr.rs:LL:COL |
| 35 | + | |
| 36 | +LL | intrinsics::offset(self, count) |
| 37 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 38 | + | | |
| 39 | + | inbounds test failed: pointer must be in-bounds at offset 101, but is outside bounds of allocN which has size 100 |
| 40 | + | inside `std::ptr::const_ptr::<impl *const u8>::offset` at $SRC_DIR/libcore/ptr/const_ptr.rs:LL:COL |
| 41 | + | inside `AFTER_ARRAY` at $DIR/offset_ub.rs:9:45 |
| 42 | + | |
| 43 | + ::: $DIR/offset_ub.rs:9:1 |
| 44 | + | |
| 45 | +LL | pub const AFTER_ARRAY: *const u8 = unsafe { [0u8; 100].as_ptr().offset(101) }; |
| 46 | + | ------------------------------------------------------------------------------ |
| 47 | + |
| 48 | +error: any use of this value will cause an error |
| 49 | + --> $SRC_DIR/libcore/ptr/const_ptr.rs:LL:COL |
| 50 | + | |
| 51 | +LL | intrinsics::offset(self, count) |
| 52 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 53 | + | | |
| 54 | + | inbounds pointer arithmetic: overflow computing offset |
| 55 | + | inside `std::ptr::const_ptr::<impl *const u16>::offset` at $SRC_DIR/libcore/ptr/const_ptr.rs:LL:COL |
| 56 | + | inside `OVERFLOW` at $DIR/offset_ub.rs:11:43 |
| 57 | + | |
| 58 | + ::: $DIR/offset_ub.rs:11:1 |
| 59 | + | |
| 60 | +LL | pub const OVERFLOW: *const u16 = unsafe { [0u16; 1].as_ptr().offset(isize::MAX) }; |
| 61 | + | ---------------------------------------------------------------------------------- |
| 62 | + |
| 63 | +error: any use of this value will cause an error |
| 64 | + --> $SRC_DIR/libcore/ptr/const_ptr.rs:LL:COL |
| 65 | + | |
| 66 | +LL | intrinsics::offset(self, count) |
| 67 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 68 | + | | |
| 69 | + | inbounds pointer arithmetic: overflow computing offset |
| 70 | + | inside `std::ptr::const_ptr::<impl *const u16>::offset` at $SRC_DIR/libcore/ptr/const_ptr.rs:LL:COL |
| 71 | + | inside `UNDERFLOW` at $DIR/offset_ub.rs:12:44 |
| 72 | + | |
| 73 | + ::: $DIR/offset_ub.rs:12:1 |
| 74 | + | |
| 75 | +LL | pub const UNDERFLOW: *const u16 = unsafe { [0u16; 1].as_ptr().offset(isize::MIN) }; |
| 76 | + | ----------------------------------------------------------------------------------- |
| 77 | + |
| 78 | +error: any use of this value will cause an error |
| 79 | + --> $SRC_DIR/libcore/ptr/const_ptr.rs:LL:COL |
| 80 | + | |
| 81 | +LL | intrinsics::offset(self, count) |
| 82 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 83 | + | | |
| 84 | + | overflowing in-bounds pointer arithmetic |
| 85 | + | inside `std::ptr::const_ptr::<impl *const u8>::offset` at $SRC_DIR/libcore/ptr/const_ptr.rs:LL:COL |
| 86 | + | inside `OVERFLOW_ADDRESS_SPACE` at $DIR/offset_ub.rs:13:56 |
| 87 | + | |
| 88 | + ::: $DIR/offset_ub.rs:13:1 |
| 89 | + | |
| 90 | +LL | pub const OVERFLOW_ADDRESS_SPACE: *const u8 = unsafe { (usize::MAX as *const u8).offset(2) }; |
| 91 | + | --------------------------------------------------------------------------------------------- |
| 92 | + |
| 93 | +error: any use of this value will cause an error |
| 94 | + --> $SRC_DIR/libcore/ptr/const_ptr.rs:LL:COL |
| 95 | + | |
| 96 | +LL | intrinsics::offset(self, count) |
| 97 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 98 | + | | |
| 99 | + | overflowing in-bounds pointer arithmetic |
| 100 | + | inside `std::ptr::const_ptr::<impl *const u8>::offset` at $SRC_DIR/libcore/ptr/const_ptr.rs:LL:COL |
| 101 | + | inside `UNDERFLOW_ADDRESS_SPACE` at $DIR/offset_ub.rs:14:57 |
| 102 | + | |
| 103 | + ::: $DIR/offset_ub.rs:14:1 |
| 104 | + | |
| 105 | +LL | pub const UNDERFLOW_ADDRESS_SPACE: *const u8 = unsafe { (1 as *const u8).offset(-2) }; |
| 106 | + | -------------------------------------------------------------------------------------- |
| 107 | + |
| 108 | +error: any use of this value will cause an error |
| 109 | + --> $SRC_DIR/libcore/ptr/const_ptr.rs:LL:COL |
| 110 | + | |
| 111 | +LL | intrinsics::offset(self, count) |
| 112 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 113 | + | | |
| 114 | + | inbounds test failed: pointer must be in-bounds at offset 1, but is outside bounds of allocN which has size 0 |
| 115 | + | inside `std::ptr::const_ptr::<impl *const u8>::offset` at $SRC_DIR/libcore/ptr/const_ptr.rs:LL:COL |
| 116 | + | inside `ZERO_SIZED_ALLOC` at $DIR/offset_ub.rs:16:50 |
| 117 | + | |
| 118 | + ::: $DIR/offset_ub.rs:16:1 |
| 119 | + | |
| 120 | +LL | pub const ZERO_SIZED_ALLOC: *const u8 = unsafe { [0u8; 0].as_ptr().offset(1) }; |
| 121 | + | ------------------------------------------------------------------------------- |
| 122 | + |
| 123 | +error: any use of this value will cause an error |
| 124 | + --> $SRC_DIR/libcore/ptr/mut_ptr.rs:LL:COL |
| 125 | + | |
| 126 | +LL | intrinsics::offset(self, count) as *mut T |
| 127 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 128 | + | | |
| 129 | + | unable to turn bytes into a pointer |
| 130 | + | inside `std::ptr::mut_ptr::<impl *mut u8>::offset` at $SRC_DIR/libcore/ptr/mut_ptr.rs:LL:COL |
| 131 | + | inside `DANGLING` at $DIR/offset_ub.rs:17:42 |
| 132 | + | |
| 133 | + ::: $DIR/offset_ub.rs:17:1 |
| 134 | + | |
| 135 | +LL | pub const DANGLING: *const u8 = unsafe { ptr::NonNull::<u8>::dangling().as_ptr().offset(4) }; |
| 136 | + | --------------------------------------------------------------------------------------------- |
| 137 | + |
| 138 | +error: any use of this value will cause an error |
| 139 | + --> $SRC_DIR/libcore/ptr/const_ptr.rs:LL:COL |
| 140 | + | |
| 141 | +LL | intrinsics::offset(self, count) |
| 142 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 143 | + | | |
| 144 | + | inbounds test failed: 0x0 is not a valid pointer |
| 145 | + | inside `std::ptr::const_ptr::<impl *const u8>::offset` at $SRC_DIR/libcore/ptr/const_ptr.rs:LL:COL |
| 146 | + | inside `NULL_OFFSET_ZERO` at $DIR/offset_ub.rs:20:50 |
| 147 | + | |
| 148 | + ::: $DIR/offset_ub.rs:20:1 |
| 149 | + | |
| 150 | +LL | pub const NULL_OFFSET_ZERO: *const u8 = unsafe { ptr::null::<u8>().offset(0) }; |
| 151 | + | ------------------------------------------------------------------------------- |
| 152 | + |
| 153 | +error: aborting due to 10 previous errors |
| 154 | + |
0 commit comments