11error: any use of this value will cause an error
22 --> $SRC_DIR/libcore/ptr/const_ptr.rs:LL:COL
33 |
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
4+ LL | unsafe { 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
1010 |
1111 ::: $DIR/offset_ub.rs:7:1
1212 |
@@ -18,12 +18,12 @@ LL | pub const BEFORE_START: *const u8 = unsafe { (&0u8 as *const u8).offset(-1)
1818error: any use of this value will cause an error
1919 --> $SRC_DIR/libcore/ptr/const_ptr.rs:LL:COL
2020 |
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
21+ LL | unsafe { 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
2727 |
2828 ::: $DIR/offset_ub.rs:8:1
2929 |
@@ -33,12 +33,12 @@ LL | pub const AFTER_END: *const u8 = unsafe { (&0u8 as *const u8).offset(2) };
3333error: any use of this value will cause an error
3434 --> $SRC_DIR/libcore/ptr/const_ptr.rs:LL:COL
3535 |
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
36+ LL | unsafe { 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
4242 |
4343 ::: $DIR/offset_ub.rs:9:1
4444 |
@@ -48,12 +48,12 @@ LL | pub const AFTER_ARRAY: *const u8 = unsafe { [0u8; 100].as_ptr().offset(101)
4848error: any use of this value will cause an error
4949 --> $SRC_DIR/libcore/ptr/const_ptr.rs:LL:COL
5050 |
51- LL | intrinsics::offset(self, count)
52- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
53- | |
54- | overflowing in-bounds pointer arithmetic
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
51+ LL | unsafe { intrinsics::offset(self, count) }
52+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
53+ | |
54+ | overflowing in-bounds pointer arithmetic
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
5757 |
5858 ::: $DIR/offset_ub.rs:11:1
5959 |
@@ -63,12 +63,12 @@ LL | pub const OVERFLOW: *const u16 = unsafe { [0u16; 1].as_ptr().offset(isize::
6363error: any use of this value will cause an error
6464 --> $SRC_DIR/libcore/ptr/const_ptr.rs:LL:COL
6565 |
66- LL | intrinsics::offset(self, count)
67- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
68- | |
69- | overflowing in-bounds pointer arithmetic
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
66+ LL | unsafe { intrinsics::offset(self, count) }
67+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
68+ | |
69+ | overflowing in-bounds pointer arithmetic
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
7272 |
7373 ::: $DIR/offset_ub.rs:12:1
7474 |
@@ -78,12 +78,12 @@ LL | pub const UNDERFLOW: *const u16 = unsafe { [0u16; 1].as_ptr().offset(isize:
7878error: any use of this value will cause an error
7979 --> $SRC_DIR/libcore/ptr/const_ptr.rs:LL:COL
8080 |
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
81+ LL | unsafe { 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
8787 |
8888 ::: $DIR/offset_ub.rs:13:1
8989 |
@@ -93,12 +93,12 @@ LL | pub const OVERFLOW_ADDRESS_SPACE: *const u8 = unsafe { (usize::MAX as *cons
9393error: any use of this value will cause an error
9494 --> $SRC_DIR/libcore/ptr/const_ptr.rs:LL:COL
9595 |
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
96+ LL | unsafe { 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
102102 |
103103 ::: $DIR/offset_ub.rs:14:1
104104 |
@@ -108,12 +108,12 @@ LL | pub const UNDERFLOW_ADDRESS_SPACE: *const u8 = unsafe { (1 as *const u8).of
108108error: any use of this value will cause an error
109109 --> $SRC_DIR/libcore/ptr/const_ptr.rs:LL:COL
110110 |
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
111+ LL | unsafe { 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
117117 |
118118 ::: $DIR/offset_ub.rs:16:1
119119 |
@@ -123,12 +123,12 @@ LL | pub const ZERO_SIZED_ALLOC: *const u8 = unsafe { [0u8; 0].as_ptr().offset(1
123123error: any use of this value will cause an error
124124 --> $SRC_DIR/libcore/ptr/mut_ptr.rs:LL:COL
125125 |
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
126+ LL | unsafe { 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
132132 |
133133 ::: $DIR/offset_ub.rs:17:1
134134 |
@@ -138,12 +138,12 @@ LL | pub const DANGLING: *const u8 = unsafe { ptr::NonNull::<u8>::dangling().as_
138138error: any use of this value will cause an error
139139 --> $SRC_DIR/libcore/ptr/const_ptr.rs:LL:COL
140140 |
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
141+ LL | unsafe { 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
147147 |
148148 ::: $DIR/offset_ub.rs:20:1
149149 |
@@ -153,12 +153,12 @@ LL | pub const NULL_OFFSET_ZERO: *const u8 = unsafe { ptr::null::<u8>().offset(0
153153error: any use of this value will cause an error
154154 --> $SRC_DIR/libcore/ptr/const_ptr.rs:LL:COL
155155 |
156- LL | intrinsics::offset(self, count)
157- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
158- | |
159- | unable to turn bytes into a pointer
160- | inside `std::ptr::const_ptr::<impl *const u8>::offset` at $SRC_DIR/libcore/ptr/const_ptr.rs:LL:COL
161- | inside `UNDERFLOW_ABS` at $DIR/offset_ub.rs:23:47
156+ LL | unsafe { intrinsics::offset(self, count) }
157+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
158+ | |
159+ | unable to turn bytes into a pointer
160+ | inside `std::ptr::const_ptr::<impl *const u8>::offset` at $SRC_DIR/libcore/ptr/const_ptr.rs:LL:COL
161+ | inside `UNDERFLOW_ABS` at $DIR/offset_ub.rs:23:47
162162 |
163163 ::: $DIR/offset_ub.rs:23:1
164164 |
0 commit comments