@@ -7,10 +7,10 @@ LL | &*ptr::slice_from_raw_parts(data, len)
7
7
| dereferencing pointer failed: null pointer is a dangling pointer (it has no provenance)
8
8
| inside `std::slice::from_raw_parts::<'_, u32>` at $SRC_DIR/core/src/slice/raw.rs:LL:COL
9
9
|
10
- ::: $DIR/forbidden_slices.rs:18 :34
10
+ ::: $DIR/forbidden_slices.rs:19 :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` at $DIR/forbidden_slices.rs:19 :34
14
14
15
15
error[E0080]: could not evaluate static initializer
16
16
--> $SRC_DIR/core/src/slice/raw.rs:LL:COL
@@ -21,10 +21,10 @@ LL | &*ptr::slice_from_raw_parts(data, len)
21
21
| dereferencing pointer failed: null pointer is a dangling pointer (it has no provenance)
22
22
| inside `std::slice::from_raw_parts::<'_, ()>` at $SRC_DIR/core/src/slice/raw.rs:LL:COL
23
23
|
24
- ::: $DIR/forbidden_slices.rs:19 :33
24
+ ::: $DIR/forbidden_slices.rs:20 :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` at $DIR/forbidden_slices.rs:20 :33
28
28
29
29
error[E0080]: could not evaluate static initializer
30
30
--> $SRC_DIR/core/src/slice/raw.rs:LL:COL
@@ -35,13 +35,13 @@ LL | &*ptr::slice_from_raw_parts(data, len)
35
35
| dereferencing pointer failed: ALLOC_ID has size 4, so pointer to 8 bytes starting at offset 0 is out-of-bounds
36
36
| inside `std::slice::from_raw_parts::<'_, u32>` at $SRC_DIR/core/src/slice/raw.rs:LL:COL
37
37
|
38
- ::: $DIR/forbidden_slices.rs:22 :34
38
+ ::: $DIR/forbidden_slices.rs:23 :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` at $DIR/forbidden_slices.rs:23 :34
42
42
43
43
error[E0080]: it is undefined behavior to use this value
44
- --> $DIR/forbidden_slices.rs:25 :1
44
+ --> $DIR/forbidden_slices.rs:26 :1
45
45
|
46
46
LL | pub static S4: &[u8] = unsafe { from_raw_parts((&D1) as *const _ as _, 1) };
47
47
| ^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>[0]: encountered uninitialized bytes
@@ -52,7 +52,7 @@ LL | pub static S4: &[u8] = unsafe { from_raw_parts((&D1) as *const _ as _, 1) }
52
52
}
53
53
54
54
error[E0080]: it is undefined behavior to use this value
55
- --> $DIR/forbidden_slices.rs:27 :1
55
+ --> $DIR/forbidden_slices.rs:28 :1
56
56
|
57
57
LL | pub static S5: &[u8] = unsafe { from_raw_parts((&D3) as *const _ as _, size_of::<&u32>()) };
58
58
| ^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
@@ -64,7 +64,7 @@ LL | pub static S5: &[u8] = unsafe { from_raw_parts((&D3) as *const _ as _, size
64
64
}
65
65
66
66
error[E0080]: it is undefined behavior to use this value
67
- --> $DIR/forbidden_slices.rs:29 :1
67
+ --> $DIR/forbidden_slices.rs:30 :1
68
68
|
69
69
LL | pub static S6: &[bool] = unsafe { from_raw_parts((&D0) as *const _ as _, 4) };
70
70
| ^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>[0]: encountered 0x11, but expected a boolean
@@ -75,7 +75,7 @@ LL | pub static S6: &[bool] = unsafe { from_raw_parts((&D0) as *const _ as _, 4)
75
75
}
76
76
77
77
error[E0080]: it is undefined behavior to use this value
78
- --> $DIR/forbidden_slices.rs:32 :1
78
+ --> $DIR/forbidden_slices.rs:33 :1
79
79
|
80
80
LL | pub static S7: &[u16] = unsafe {
81
81
| ^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered an unaligned reference (required 2 byte alignment but found 1)
@@ -94,10 +94,10 @@ LL | &*ptr::slice_from_raw_parts(data, len)
94
94
| dereferencing pointer failed: ALLOC_ID has size 8, so pointer to 8 bytes starting at offset 1 is out-of-bounds
95
95
| inside `std::slice::from_raw_parts::<'_, u64>` at $SRC_DIR/core/src/slice/raw.rs:LL:COL
96
96
|
97
- ::: $DIR/forbidden_slices.rs:43 :5
97
+ ::: $DIR/forbidden_slices.rs:44 :5
98
98
|
99
99
LL | from_raw_parts(ptr, 1)
100
- | ---------------------- inside `S8` at $DIR/forbidden_slices.rs:43 :5
100
+ | ---------------------- inside `S8` at $DIR/forbidden_slices.rs:44 :5
101
101
102
102
error[E0080]: could not evaluate static initializer
103
103
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
@@ -113,10 +113,10 @@ LL | unsafe { intrinsics::ptr_offset_from_unsigned(self, origin) }
113
113
LL | unsafe { from_raw_parts(range.start, range.end.sub_ptr(range.start)) }
114
114
| ------------------------------ inside `from_ptr_range::<'_, u32>` at $SRC_DIR/core/src/slice/raw.rs:LL:COL
115
115
|
116
- ::: $DIR/forbidden_slices.rs:46 :34
116
+ ::: $DIR/forbidden_slices.rs:47 :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` at $DIR/forbidden_slices.rs:47 :34
120
120
121
121
error[E0080]: could not evaluate static initializer
122
122
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
@@ -132,10 +132,10 @@ LL | assert!(0 < pointee_size && pointee_size <= isize::MAX as usize);
132
132
LL | unsafe { from_raw_parts(range.start, range.end.sub_ptr(range.start)) }
133
133
| ------------------------------ inside `from_ptr_range::<'_, ()>` at $SRC_DIR/core/src/slice/raw.rs:LL:COL
134
134
|
135
- ::: $DIR/forbidden_slices.rs:47 :33
135
+ ::: $DIR/forbidden_slices.rs:48 :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` at $DIR/forbidden_slices.rs:48 :33
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
@@ -151,13 +151,13 @@ LL | unsafe { intrinsics::offset(self, count) }
151
151
LL | unsafe { self.offset(count as isize) }
152
152
| --------------------------- inside `ptr::const_ptr::<impl *const u32>::add` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
153
153
|
154
- ::: $DIR/forbidden_slices.rs:50 :25
154
+ ::: $DIR/forbidden_slices.rs:51 :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` at $DIR/forbidden_slices.rs:51 :25
158
158
159
159
error[E0080]: it is undefined behavior to use this value
160
- --> $DIR/forbidden_slices.rs:52 :1
160
+ --> $DIR/forbidden_slices.rs:53 :1
161
161
|
162
162
LL | pub static R4: &[u8] = unsafe {
163
163
| ^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>[0]: encountered uninitialized bytes
@@ -168,7 +168,7 @@ LL | pub static R4: &[u8] = unsafe {
168
168
}
169
169
170
170
error[E0080]: it is undefined behavior to use this value
171
- --> $DIR/forbidden_slices.rs:57 :1
171
+ --> $DIR/forbidden_slices.rs:58 :1
172
172
|
173
173
LL | pub static R5: &[u8] = unsafe {
174
174
| ^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
@@ -180,7 +180,7 @@ LL | pub static R5: &[u8] = unsafe {
180
180
}
181
181
182
182
error[E0080]: it is undefined behavior to use this value
183
- --> $DIR/forbidden_slices.rs:62 :1
183
+ --> $DIR/forbidden_slices.rs:63 :1
184
184
|
185
185
LL | pub static R6: &[bool] = unsafe {
186
186
| ^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>[0]: encountered 0x11, but expected a boolean
@@ -191,7 +191,7 @@ LL | pub static R6: &[bool] = unsafe {
191
191
}
192
192
193
193
error[E0080]: it is undefined behavior to use this value
194
- --> $DIR/forbidden_slices.rs:67 :1
194
+ --> $DIR/forbidden_slices.rs:68 :1
195
195
|
196
196
LL | pub static R7: &[u16] = unsafe {
197
197
| ^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered an unaligned reference (required 2 byte alignment but found 1)
@@ -213,10 +213,10 @@ LL | unsafe { intrinsics::offset(self, count) }
213
213
LL | unsafe { self.offset(count as isize) }
214
214
| --------------------------- inside `ptr::const_ptr::<impl *const u64>::add` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
215
215
|
216
- ::: $DIR/forbidden_slices.rs:74 :25
216
+ ::: $DIR/forbidden_slices.rs:75 :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` at $DIR/forbidden_slices.rs:75 :25
220
220
221
221
error[E0080]: could not evaluate static initializer
222
222
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
@@ -232,10 +232,10 @@ LL | unsafe { intrinsics::ptr_offset_from_unsigned(self, origin) }
232
232
LL | unsafe { from_raw_parts(range.start, range.end.sub_ptr(range.start)) }
233
233
| ------------------------------ inside `from_ptr_range::<'_, u32>` at $SRC_DIR/core/src/slice/raw.rs:LL:COL
234
234
|
235
- ::: $DIR/forbidden_slices.rs:79 :34
235
+ ::: $DIR/forbidden_slices.rs:80 :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` at $DIR/forbidden_slices.rs:80 :34
239
239
240
240
error[E0080]: could not evaluate static initializer
241
241
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
@@ -251,10 +251,10 @@ LL | unsafe { intrinsics::ptr_offset_from_unsigned(self, origin) }
251
251
LL | unsafe { from_raw_parts(range.start, range.end.sub_ptr(range.start)) }
252
252
| ------------------------------ inside `from_ptr_range::<'_, u32>` at $SRC_DIR/core/src/slice/raw.rs:LL:COL
253
253
|
254
- ::: $DIR/forbidden_slices.rs:80 :35
254
+ ::: $DIR/forbidden_slices.rs:81 :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` at $DIR/forbidden_slices.rs:81 :35
258
258
259
259
error: aborting due to 18 previous errors
260
260
0 commit comments