@@ -5,12 +5,12 @@ LL | &*ptr::slice_from_raw_parts(data, len)
5
5
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6
6
| |
7
7
| 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>`
9
9
|
10
10
::: $DIR/forbidden_slices.rs:18:34
11
11
|
12
12
LL | pub static S0: &[u32] = unsafe { from_raw_parts(ptr::null(), 0) };
13
- | ------------------------------ inside `S0` at $DIR/forbidden_slices.rs:18:34
13
+ | ------------------------------ inside `S0`
14
14
15
15
error[E0080]: could not evaluate static initializer
16
16
--> $SRC_DIR/core/src/slice/raw.rs:LL:COL
@@ -19,12 +19,12 @@ LL | &*ptr::slice_from_raw_parts(data, len)
19
19
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
20
20
| |
21
21
| 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::<'_, ()>`
23
23
|
24
24
::: $DIR/forbidden_slices.rs:19:33
25
25
|
26
26
LL | pub static S1: &[()] = unsafe { from_raw_parts(ptr::null(), 0) };
27
- | ------------------------------ inside `S1` at $DIR/forbidden_slices.rs:19:33
27
+ | ------------------------------ inside `S1`
28
28
29
29
error[E0080]: could not evaluate static initializer
30
30
--> $SRC_DIR/core/src/slice/raw.rs:LL:COL
@@ -33,12 +33,12 @@ LL | &*ptr::slice_from_raw_parts(data, len)
33
33
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
34
34
| |
35
35
| 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>`
37
37
|
38
38
::: $DIR/forbidden_slices.rs:22:34
39
39
|
40
40
LL | pub static S2: &[u32] = unsafe { from_raw_parts(&D0, 2) };
41
- | ---------------------- inside `S2` at $DIR/forbidden_slices.rs:22:34
41
+ | ---------------------- inside `S2`
42
42
43
43
error[E0080]: it is undefined behavior to use this value
44
44
--> $DIR/forbidden_slices.rs:25:1
@@ -92,12 +92,12 @@ LL | &*ptr::slice_from_raw_parts(data, len)
92
92
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
93
93
| |
94
94
| 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>`
96
96
|
97
97
::: $DIR/forbidden_slices.rs:43:5
98
98
|
99
99
LL | from_raw_parts(ptr, 1)
100
- | ---------------------- inside `S8` at $DIR/forbidden_slices.rs:43:5
100
+ | ---------------------- inside `S8`
101
101
102
102
error[E0080]: could not evaluate static initializer
103
103
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
@@ -106,17 +106,17 @@ LL | unsafe { intrinsics::ptr_offset_from_unsigned(self, origin) }
106
106
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
107
107
| |
108
108
| 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`
110
110
|
111
111
::: $SRC_DIR/core/src/slice/raw.rs:LL:COL
112
112
|
113
113
LL | 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>`
115
115
|
116
116
::: $DIR/forbidden_slices.rs:46:34
117
117
|
118
118
LL | 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`
120
120
121
121
error[E0080]: could not evaluate static initializer
122
122
--> $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);
125
125
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
126
126
| |
127
127
| 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`
129
129
|
130
130
::: $SRC_DIR/core/src/slice/raw.rs:LL:COL
131
131
|
132
132
LL | 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::<'_, ()>`
134
134
|
135
135
::: $DIR/forbidden_slices.rs:47:33
136
136
|
137
137
LL | pub static R1: &[()] = unsafe { from_ptr_range(ptr::null()..ptr::null()) };
138
- | ---------------------------------------- inside `R1` at $DIR/forbidden_slices.rs:47:33
138
+ | ---------------------------------------- inside `R1`
139
139
|
140
140
= note: this error originates in the macro `assert` (in Nightly builds, run with -Z macro-backtrace for more info)
141
141
@@ -146,15 +146,15 @@ LL | unsafe { intrinsics::offset(self, count) }
146
146
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
147
147
| |
148
148
| 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`
150
150
...
151
151
LL | 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`
153
153
|
154
154
::: $DIR/forbidden_slices.rs:50:25
155
155
|
156
156
LL | from_ptr_range(ptr..ptr.add(2))
157
- | ---------- inside `R2` at $DIR/forbidden_slices.rs:50:25
157
+ | ---------- inside `R2`
158
158
159
159
error[E0080]: it is undefined behavior to use this value
160
160
--> $DIR/forbidden_slices.rs:52:1
@@ -208,15 +208,15 @@ LL | unsafe { intrinsics::offset(self, count) }
208
208
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
209
209
| |
210
210
| 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`
212
212
...
213
213
LL | 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`
215
215
|
216
216
::: $DIR/forbidden_slices.rs:74:25
217
217
|
218
218
LL | from_ptr_range(ptr..ptr.add(1))
219
- | ---------- inside `R8` at $DIR/forbidden_slices.rs:74:25
219
+ | ---------- inside `R8`
220
220
221
221
error[E0080]: could not evaluate static initializer
222
222
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
@@ -225,17 +225,17 @@ LL | unsafe { intrinsics::ptr_offset_from_unsigned(self, origin) }
225
225
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
226
226
| |
227
227
| `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`
229
229
|
230
230
::: $SRC_DIR/core/src/slice/raw.rs:LL:COL
231
231
|
232
232
LL | 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>`
234
234
|
235
235
::: $DIR/forbidden_slices.rs:79:34
236
236
|
237
237
LL | 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`
239
239
240
240
error[E0080]: could not evaluate static initializer
241
241
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
@@ -244,17 +244,17 @@ LL | unsafe { intrinsics::ptr_offset_from_unsigned(self, origin) }
244
244
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
245
245
| |
246
246
| `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`
248
248
|
249
249
::: $SRC_DIR/core/src/slice/raw.rs:LL:COL
250
250
|
251
251
LL | 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>`
253
253
|
254
254
::: $DIR/forbidden_slices.rs:80:35
255
255
|
256
256
LL | pub static R10: &[u32] = unsafe { from_ptr_range(&D0..&D0) };
257
- | ------------------------ inside `R10` at $DIR/forbidden_slices.rs:80:35
257
+ | ------------------------ inside `R10`
258
258
259
259
error: aborting due to 18 previous errors
260
260
0 commit comments