@@ -5,12 +5,12 @@ LL | &*ptr::slice_from_raw_parts(data, len)
55 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
66 | |
77 | dereferencing pointer failed: null pointer is a dangling pointer (it has no provenance)
8- | inside `std::slice::from_raw_parts::<'_, u32>` at $SRC_DIR/core/src/slice/raw.rs:LL:COL
8+ | inside `std::slice::from_raw_parts::<'_, u32>`
99 |
1010 ::: $DIR/forbidden_slices.rs:18:34
1111 |
1212LL | pub static S0: &[u32] = unsafe { from_raw_parts(ptr::null(), 0) };
13- | ------------------------------ inside `S0` at $DIR/forbidden_slices.rs:18:34
13+ | ------------------------------ inside `S0`
1414
1515error[E0080]: could not evaluate static initializer
1616 --> $SRC_DIR/core/src/slice/raw.rs:LL:COL
@@ -19,12 +19,12 @@ LL | &*ptr::slice_from_raw_parts(data, len)
1919 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2020 | |
2121 | dereferencing pointer failed: null pointer is a dangling pointer (it has no provenance)
22- | inside `std::slice::from_raw_parts::<'_, ()>` at $SRC_DIR/core/src/slice/raw.rs:LL:COL
22+ | inside `std::slice::from_raw_parts::<'_, ()>`
2323 |
2424 ::: $DIR/forbidden_slices.rs:19:33
2525 |
2626LL | pub static S1: &[()] = unsafe { from_raw_parts(ptr::null(), 0) };
27- | ------------------------------ inside `S1` at $DIR/forbidden_slices.rs:19:33
27+ | ------------------------------ inside `S1`
2828
2929error[E0080]: could not evaluate static initializer
3030 --> $SRC_DIR/core/src/slice/raw.rs:LL:COL
@@ -33,12 +33,12 @@ LL | &*ptr::slice_from_raw_parts(data, len)
3333 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3434 | |
3535 | dereferencing pointer failed: ALLOC_ID has size 4, so pointer to 8 bytes starting at offset 0 is out-of-bounds
36- | inside `std::slice::from_raw_parts::<'_, u32>` at $SRC_DIR/core/src/slice/raw.rs:LL:COL
36+ | inside `std::slice::from_raw_parts::<'_, u32>`
3737 |
3838 ::: $DIR/forbidden_slices.rs:22:34
3939 |
4040LL | pub static S2: &[u32] = unsafe { from_raw_parts(&D0, 2) };
41- | ---------------------- inside `S2` at $DIR/forbidden_slices.rs:22:34
41+ | ---------------------- inside `S2`
4242
4343error[E0080]: it is undefined behavior to use this value
4444 --> $DIR/forbidden_slices.rs:25:1
@@ -92,12 +92,12 @@ LL | &*ptr::slice_from_raw_parts(data, len)
9292 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
9393 | |
9494 | dereferencing pointer failed: ALLOC_ID has size 8, so pointer to 8 bytes starting at offset 1 is out-of-bounds
95- | inside `std::slice::from_raw_parts::<'_, u64>` at $SRC_DIR/core/src/slice/raw.rs:LL:COL
95+ | inside `std::slice::from_raw_parts::<'_, u64>`
9696 |
9797 ::: $DIR/forbidden_slices.rs:43:5
9898 |
9999LL | from_raw_parts(ptr, 1)
100- | ---------------------- inside `S8` at $DIR/forbidden_slices.rs:43:5
100+ | ---------------------- inside `S8`
101101
102102error[E0080]: could not evaluate static initializer
103103 --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
@@ -106,17 +106,17 @@ LL | unsafe { intrinsics::ptr_offset_from_unsigned(self, origin) }
106106 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
107107 | |
108108 | out-of-bounds offset_from: null pointer is a dangling pointer (it has no provenance)
109- | inside `ptr::const_ptr::<impl *const u32>::sub_ptr` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
109+ | inside `ptr::const_ptr::<impl *const u32>::sub_ptr`
110110 |
111111 ::: $SRC_DIR/core/src/slice/raw.rs:LL:COL
112112 |
113113LL | unsafe { from_raw_parts(range.start, range.end.sub_ptr(range.start)) }
114- | ------------------------------ inside `from_ptr_range::<'_, u32>` at $SRC_DIR/core/src/slice/raw.rs:LL:COL
114+ | ------------------------------ inside `from_ptr_range::<'_, u32>`
115115 |
116116 ::: $DIR/forbidden_slices.rs:46:34
117117 |
118118LL | pub static R0: &[u32] = unsafe { from_ptr_range(ptr::null()..ptr::null()) };
119- | ---------------------------------------- inside `R0` at $DIR/forbidden_slices.rs:46:34
119+ | ---------------------------------------- inside `R0`
120120
121121error[E0080]: could not evaluate static initializer
122122 --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
@@ -125,17 +125,17 @@ LL | assert!(0 < pointee_size && pointee_size <= isize::MAX as usize);
125125 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
126126 | |
127127 | the evaluated program panicked at 'assertion failed: 0 < pointee_size && pointee_size <= isize::MAX as usize', $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
128- | inside `ptr::const_ptr::<impl *const ()>::sub_ptr` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
128+ | inside `ptr::const_ptr::<impl *const ()>::sub_ptr`
129129 |
130130 ::: $SRC_DIR/core/src/slice/raw.rs:LL:COL
131131 |
132132LL | unsafe { from_raw_parts(range.start, range.end.sub_ptr(range.start)) }
133- | ------------------------------ inside `from_ptr_range::<'_, ()>` at $SRC_DIR/core/src/slice/raw.rs:LL:COL
133+ | ------------------------------ inside `from_ptr_range::<'_, ()>`
134134 |
135135 ::: $DIR/forbidden_slices.rs:47:33
136136 |
137137LL | pub static R1: &[()] = unsafe { from_ptr_range(ptr::null()..ptr::null()) };
138- | ---------------------------------------- inside `R1` at $DIR/forbidden_slices.rs:47:33
138+ | ---------------------------------------- inside `R1`
139139 |
140140 = note: this error originates in the macro `assert` (in Nightly builds, run with -Z macro-backtrace for more info)
141141
@@ -146,15 +146,15 @@ LL | unsafe { intrinsics::offset(self, count) }
146146 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
147147 | |
148148 | out-of-bounds pointer arithmetic: ALLOC_ID has size 4, so pointer to 8 bytes starting at offset 0 is out-of-bounds
149- | inside `ptr::const_ptr::<impl *const u32>::offset` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
149+ | inside `ptr::const_ptr::<impl *const u32>::offset`
150150...
151151LL | unsafe { self.offset(count as isize) }
152- | --------------------------- inside `ptr::const_ptr::<impl *const u32>::add` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
152+ | --------------------------- inside `ptr::const_ptr::<impl *const u32>::add`
153153 |
154154 ::: $DIR/forbidden_slices.rs:50:25
155155 |
156156LL | from_ptr_range(ptr..ptr.add(2))
157- | ---------- inside `R2` at $DIR/forbidden_slices.rs:50:25
157+ | ---------- inside `R2`
158158
159159error[E0080]: it is undefined behavior to use this value
160160 --> $DIR/forbidden_slices.rs:52:1
@@ -208,15 +208,15 @@ LL | unsafe { intrinsics::offset(self, count) }
208208 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
209209 | |
210210 | out-of-bounds pointer arithmetic: ALLOC_ID has size 8, so pointer to 8 bytes starting at offset 1 is out-of-bounds
211- | inside `ptr::const_ptr::<impl *const u64>::offset` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
211+ | inside `ptr::const_ptr::<impl *const u64>::offset`
212212...
213213LL | unsafe { self.offset(count as isize) }
214- | --------------------------- inside `ptr::const_ptr::<impl *const u64>::add` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
214+ | --------------------------- inside `ptr::const_ptr::<impl *const u64>::add`
215215 |
216216 ::: $DIR/forbidden_slices.rs:74:25
217217 |
218218LL | from_ptr_range(ptr..ptr.add(1))
219- | ---------- inside `R8` at $DIR/forbidden_slices.rs:74:25
219+ | ---------- inside `R8`
220220
221221error[E0080]: could not evaluate static initializer
222222 --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
@@ -225,17 +225,17 @@ LL | unsafe { intrinsics::ptr_offset_from_unsigned(self, origin) }
225225 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
226226 | |
227227 | `ptr_offset_from_unsigned` called on pointers into different allocations
228- | inside `ptr::const_ptr::<impl *const u32>::sub_ptr` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
228+ | inside `ptr::const_ptr::<impl *const u32>::sub_ptr`
229229 |
230230 ::: $SRC_DIR/core/src/slice/raw.rs:LL:COL
231231 |
232232LL | unsafe { from_raw_parts(range.start, range.end.sub_ptr(range.start)) }
233- | ------------------------------ inside `from_ptr_range::<'_, u32>` at $SRC_DIR/core/src/slice/raw.rs:LL:COL
233+ | ------------------------------ inside `from_ptr_range::<'_, u32>`
234234 |
235235 ::: $DIR/forbidden_slices.rs:79:34
236236 |
237237LL | pub static R9: &[u32] = unsafe { from_ptr_range(&D0..(&D0 as *const u32).add(1)) };
238- | ----------------------------------------------- inside `R9` at $DIR/forbidden_slices.rs:79:34
238+ | ----------------------------------------------- inside `R9`
239239
240240error[E0080]: could not evaluate static initializer
241241 --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
@@ -244,17 +244,17 @@ LL | unsafe { intrinsics::ptr_offset_from_unsigned(self, origin) }
244244 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
245245 | |
246246 | `ptr_offset_from_unsigned` called on pointers into different allocations
247- | inside `ptr::const_ptr::<impl *const u32>::sub_ptr` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
247+ | inside `ptr::const_ptr::<impl *const u32>::sub_ptr`
248248 |
249249 ::: $SRC_DIR/core/src/slice/raw.rs:LL:COL
250250 |
251251LL | unsafe { from_raw_parts(range.start, range.end.sub_ptr(range.start)) }
252- | ------------------------------ inside `from_ptr_range::<'_, u32>` at $SRC_DIR/core/src/slice/raw.rs:LL:COL
252+ | ------------------------------ inside `from_ptr_range::<'_, u32>`
253253 |
254254 ::: $DIR/forbidden_slices.rs:80:35
255255 |
256256LL | pub static R10: &[u32] = unsafe { from_ptr_range(&D0..&D0) };
257- | ------------------------ inside `R10` at $DIR/forbidden_slices.rs:80:35
257+ | ------------------------ inside `R10`
258258
259259error: aborting due to 18 previous errors
260260
0 commit comments