@@ -2,43 +2,52 @@ error[E0080]: could not evaluate static initializer
2
2
--> $SRC_DIR/core/src/slice/raw.rs:LL:COL
3
3
|
4
4
LL | &*ptr::slice_from_raw_parts(data, len)
5
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6
- | |
7
- | dereferencing pointer failed: null pointer is a dangling pointer (it has no provenance)
8
- | inside `std:: slice::from_raw_parts::<'_, u32>`
5
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ dereferencing pointer failed: null pointer is a dangling pointer (it has no provenance)
6
+ |
7
+ note: inside `std::slice::from_raw_parts::<'_, u32>`
8
+ --> $SRC_DIR/core/src/ slice/raw.rs:LL:COL
9
9
|
10
- ::: $DIR/forbidden_slices.rs:18:34
10
+ LL | &*ptr::slice_from_raw_parts(data, len)
11
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
12
+ note: inside `S0`
13
+ --> $DIR/forbidden_slices.rs:18:34
11
14
|
12
15
LL | pub static S0: &[u32] = unsafe { from_raw_parts(ptr::null(), 0) };
13
- | ------------------------------ inside `S0`
16
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
14
17
15
18
error[E0080]: could not evaluate static initializer
16
19
--> $SRC_DIR/core/src/slice/raw.rs:LL:COL
17
20
|
18
21
LL | &*ptr::slice_from_raw_parts(data, len)
19
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
20
- | |
21
- | dereferencing pointer failed: null pointer is a dangling pointer (it has no provenance)
22
- | inside `std:: slice::from_raw_parts::<'_, ()>`
22
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ dereferencing pointer failed: null pointer is a dangling pointer (it has no provenance)
23
+ |
24
+ note: inside `std::slice::from_raw_parts::<'_, ()>`
25
+ --> $SRC_DIR/core/src/ slice/raw.rs:LL:COL
23
26
|
24
- ::: $DIR/forbidden_slices.rs:19:33
27
+ LL | &*ptr::slice_from_raw_parts(data, len)
28
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
29
+ note: inside `S1`
30
+ --> $DIR/forbidden_slices.rs:19:33
25
31
|
26
32
LL | pub static S1: &[()] = unsafe { from_raw_parts(ptr::null(), 0) };
27
- | ------------------------------ inside `S1`
33
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
28
34
29
35
error[E0080]: could not evaluate static initializer
30
36
--> $SRC_DIR/core/src/slice/raw.rs:LL:COL
31
37
|
32
38
LL | &*ptr::slice_from_raw_parts(data, len)
33
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
34
- | |
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>`
39
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ dereferencing pointer failed: ALLOC_ID has size 4, so pointer to 8 bytes starting at offset 0 is out-of-bounds
40
+ |
41
+ note: inside `std::slice::from_raw_parts::<'_, u32>`
42
+ --> $SRC_DIR/core/src/ slice/raw.rs:LL:COL
37
43
|
38
- ::: $DIR/forbidden_slices.rs:22:34
44
+ LL | &*ptr::slice_from_raw_parts(data, len)
45
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
46
+ note: inside `S2`
47
+ --> $DIR/forbidden_slices.rs:22:34
39
48
|
40
49
LL | pub static S2: &[u32] = unsafe { from_raw_parts(&D0, 2) };
41
- | ---------------------- inside `S2`
50
+ | ^^^^^^^^^^^^^^^^^^^^^^
42
51
43
52
error[E0080]: it is undefined behavior to use this value
44
53
--> $DIR/forbidden_slices.rs:25:1
@@ -89,72 +98,85 @@ error[E0080]: could not evaluate static initializer
89
98
--> $SRC_DIR/core/src/slice/raw.rs:LL:COL
90
99
|
91
100
LL | &*ptr::slice_from_raw_parts(data, len)
92
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
93
- | |
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>`
101
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ dereferencing pointer failed: ALLOC_ID has size 8, so pointer to 8 bytes starting at offset 1 is out-of-bounds
96
102
|
97
- ::: $DIR/forbidden_slices.rs:43:5
103
+ note: inside `std::slice::from_raw_parts::<'_, u64>`
104
+ --> $SRC_DIR/core/src/slice/raw.rs:LL:COL
105
+ |
106
+ LL | &*ptr::slice_from_raw_parts(data, len)
107
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
108
+ note: inside `S8`
109
+ --> $DIR/forbidden_slices.rs:43:5
98
110
|
99
111
LL | from_raw_parts(ptr, 1)
100
- | ---------------------- inside `S8`
112
+ | ^^^^^^^^^^^^^^^^^^^^^^
101
113
102
114
error[E0080]: could not evaluate static initializer
103
115
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
104
116
|
105
117
LL | unsafe { intrinsics::ptr_offset_from_unsigned(self, origin) }
106
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
107
- | |
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`
118
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ out-of-bounds offset_from: null pointer is a dangling pointer (it has no provenance)
110
119
|
111
- ::: $SRC_DIR/core/src/slice/raw.rs:LL:COL
120
+ note: inside `ptr::const_ptr::<impl *const u32>::sub_ptr`
121
+ --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
112
122
|
113
- LL | unsafe { from_raw_parts(range.start, range.end.sub_ptr(range.start)) }
114
- | ------------------------------ inside `from_ptr_range::<'_, u32>`
123
+ LL | unsafe { intrinsics::ptr_offset_from_unsigned(self, origin) }
124
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
125
+ note: inside `from_ptr_range::<'_, u32>`
126
+ --> $SRC_DIR/core/src/slice/raw.rs:LL:COL
115
127
|
116
- ::: $DIR/forbidden_slices.rs:46:34
128
+ LL | unsafe { from_raw_parts(range.start, range.end.sub_ptr(range.start)) }
129
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
130
+ note: inside `R0`
131
+ --> $DIR/forbidden_slices.rs:46:34
117
132
|
118
133
LL | pub static R0: &[u32] = unsafe { from_ptr_range(ptr::null()..ptr::null()) };
119
- | ---------------------------------------- inside `R0`
134
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
120
135
121
136
error[E0080]: could not evaluate static initializer
122
137
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
123
138
|
124
139
LL | assert!(0 < pointee_size && pointee_size <= isize::MAX as usize);
125
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
126
- | |
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`
140
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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
129
141
|
130
- ::: $SRC_DIR/core/src/slice/raw.rs:LL:COL
142
+ note: inside `ptr::const_ptr::<impl *const ()>::sub_ptr`
143
+ --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
131
144
|
132
- LL | unsafe { from_raw_parts(range.start, range.end.sub_ptr(range.start)) }
133
- | ------------------------------ inside `from_ptr_range::<'_, ()>`
145
+ LL | assert!(0 < pointee_size && pointee_size <= isize::MAX as usize);
146
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
147
+ note: inside `from_ptr_range::<'_, ()>`
148
+ --> $SRC_DIR/core/src/slice/raw.rs:LL:COL
134
149
|
135
- ::: $DIR/forbidden_slices.rs:47:33
150
+ LL | unsafe { from_raw_parts(range.start, range.end.sub_ptr(range.start)) }
151
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
152
+ note: inside `R1`
153
+ --> $DIR/forbidden_slices.rs:47:33
136
154
|
137
155
LL | pub static R1: &[()] = unsafe { from_ptr_range(ptr::null()..ptr::null()) };
138
- | ---------------------------------------- inside `R1`
139
- |
156
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
140
157
= note: this error originates in the macro `assert` (in Nightly builds, run with -Z macro-backtrace for more info)
141
158
142
159
error[E0080]: could not evaluate static initializer
143
160
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
144
161
|
162
+ LL | unsafe { intrinsics::offset(self, count) }
163
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ out-of-bounds pointer arithmetic: ALLOC_ID has size 4, so pointer to 8 bytes starting at offset 0 is out-of-bounds
164
+ |
165
+ note: inside `ptr::const_ptr::<impl *const u32>::offset`
166
+ --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
167
+ |
145
168
LL | unsafe { intrinsics::offset(self, count) }
146
169
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
147
- | |
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`
150
- ...
151
- LL | unsafe { self.offset(count as isize) }
152
- | --------------------------- inside `ptr::const_ptr::<impl *const u32>::add`
170
+ note: inside `ptr::const_ptr::<impl *const u32>::add`
171
+ --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
153
172
|
154
- ::: $DIR/forbidden_slices.rs:50:25
173
+ LL | unsafe { self.offset(count as isize) }
174
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
175
+ note: inside `R2`
176
+ --> $DIR/forbidden_slices.rs:50:25
155
177
|
156
178
LL | from_ptr_range(ptr..ptr.add(2))
157
- | ---------- inside `R2`
179
+ | ^^^^^^^^^^
158
180
159
181
error[E0080]: it is undefined behavior to use this value
160
182
--> $DIR/forbidden_slices.rs:52:1
@@ -204,57 +226,68 @@ LL | pub static R7: &[u16] = unsafe {
204
226
error[E0080]: could not evaluate static initializer
205
227
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
206
228
|
229
+ LL | unsafe { intrinsics::offset(self, count) }
230
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ out-of-bounds pointer arithmetic: ALLOC_ID has size 8, so pointer to 8 bytes starting at offset 1 is out-of-bounds
231
+ |
232
+ note: inside `ptr::const_ptr::<impl *const u64>::offset`
233
+ --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
234
+ |
207
235
LL | unsafe { intrinsics::offset(self, count) }
208
236
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
209
- | |
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`
212
- ...
213
- LL | unsafe { self.offset(count as isize) }
214
- | --------------------------- inside `ptr::const_ptr::<impl *const u64>::add`
237
+ note: inside `ptr::const_ptr::<impl *const u64>::add`
238
+ --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
215
239
|
216
- ::: $DIR/forbidden_slices.rs:74:25
240
+ LL | unsafe { self.offset(count as isize) }
241
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
242
+ note: inside `R8`
243
+ --> $DIR/forbidden_slices.rs:74:25
217
244
|
218
245
LL | from_ptr_range(ptr..ptr.add(1))
219
- | ---------- inside `R8`
246
+ | ^^^^^^^^^^
220
247
221
248
error[E0080]: could not evaluate static initializer
222
249
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
223
250
|
224
251
LL | unsafe { intrinsics::ptr_offset_from_unsigned(self, origin) }
225
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
226
- | |
227
- | `ptr_offset_from_unsigned` called on pointers into different allocations
228
- | inside `ptr::const_ptr::<impl *const u32>::sub_ptr`
252
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `ptr_offset_from_unsigned` called on pointers into different allocations
229
253
|
230
- ::: $SRC_DIR/core/src/slice/raw.rs:LL:COL
254
+ note: inside `ptr::const_ptr::<impl *const u32>::sub_ptr`
255
+ --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
231
256
|
232
- LL | unsafe { from_raw_parts(range.start, range.end.sub_ptr(range.start)) }
233
- | ------------------------------ inside `from_ptr_range::<'_, u32>`
257
+ LL | unsafe { intrinsics::ptr_offset_from_unsigned(self, origin) }
258
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
259
+ note: inside `from_ptr_range::<'_, u32>`
260
+ --> $SRC_DIR/core/src/slice/raw.rs:LL:COL
234
261
|
235
- ::: $DIR/forbidden_slices.rs:79:34
262
+ LL | unsafe { from_raw_parts(range.start, range.end.sub_ptr(range.start)) }
263
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
264
+ note: inside `R9`
265
+ --> $DIR/forbidden_slices.rs:79:34
236
266
|
237
267
LL | pub static R9: &[u32] = unsafe { from_ptr_range(&D0..(&D0 as *const u32).add(1)) };
238
- | ----------------------------------------------- inside `R9`
268
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
239
269
240
270
error[E0080]: could not evaluate static initializer
241
271
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
242
272
|
243
273
LL | unsafe { intrinsics::ptr_offset_from_unsigned(self, origin) }
244
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
245
- | |
246
- | `ptr_offset_from_unsigned` called on pointers into different allocations
247
- | inside `ptr::const_ptr::<impl *const u32>::sub_ptr`
274
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `ptr_offset_from_unsigned` called on pointers into different allocations
248
275
|
249
- ::: $SRC_DIR/core/src/slice/raw.rs:LL:COL
276
+ note: inside `ptr::const_ptr::<impl *const u32>::sub_ptr`
277
+ --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
250
278
|
251
- LL | unsafe { from_raw_parts(range.start, range.end.sub_ptr(range.start)) }
252
- | ------------------------------ inside `from_ptr_range::<'_, u32>`
279
+ LL | unsafe { intrinsics::ptr_offset_from_unsigned(self, origin) }
280
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
281
+ note: inside `from_ptr_range::<'_, u32>`
282
+ --> $SRC_DIR/core/src/slice/raw.rs:LL:COL
253
283
|
254
- ::: $DIR/forbidden_slices.rs:80:35
284
+ LL | unsafe { from_raw_parts(range.start, range.end.sub_ptr(range.start)) }
285
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
286
+ note: inside `R10`
287
+ --> $DIR/forbidden_slices.rs:80:35
255
288
|
256
289
LL | pub static R10: &[u32] = unsafe { from_ptr_range(&D0..&D0) };
257
- | ------------------------ inside `R10`
290
+ | ^^^^^^^^^^^^^^^^^^^^^^^^
258
291
259
292
error: aborting due to 18 previous errors
260
293
0 commit comments