Skip to content

Commit f4fff04

Browse files
committed
--bless
1 parent 5a6fd10 commit f4fff04

File tree

1 file changed

+28
-28
lines changed

1 file changed

+28
-28
lines changed

src/test/ui/const-ptr/forbidden_slices.stderr

+28-28
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ LL | &*ptr::slice_from_raw_parts(data, len)
77
| dereferencing pointer failed: null pointer is not a valid pointer
88
| inside `std::slice::from_raw_parts::<u32>` at $SRC_DIR/core/src/slice/raw.rs:LL:COL
99
|
10-
::: $DIR/forbidden_slices.rs:15:34
10+
::: $DIR/forbidden_slices.rs:16:34
1111
|
1212
LL | pub static S0: &[u32] = unsafe { from_raw_parts(ptr::null(), 0) };
13-
| ------------------------------ inside `S0` at $DIR/forbidden_slices.rs:15:34
13+
| ------------------------------ inside `S0` at $DIR/forbidden_slices.rs:16:34
1414

1515
error[E0080]: could not evaluate static initializer
1616
--> $SRC_DIR/core/src/slice/raw.rs:LL:COL
@@ -21,10 +21,10 @@ LL | &*ptr::slice_from_raw_parts(data, len)
2121
| dereferencing pointer failed: null pointer is not a valid pointer
2222
| inside `std::slice::from_raw_parts::<()>` at $SRC_DIR/core/src/slice/raw.rs:LL:COL
2323
|
24-
::: $DIR/forbidden_slices.rs:16:33
24+
::: $DIR/forbidden_slices.rs:17:33
2525
|
2626
LL | pub static S1: &[()] = unsafe { from_raw_parts(ptr::null(), 0) };
27-
| ------------------------------ inside `S1` at $DIR/forbidden_slices.rs:16:33
27+
| ------------------------------ inside `S1` at $DIR/forbidden_slices.rs:17:33
2828

2929
error[E0080]: could not evaluate static initializer
3030
--> $SRC_DIR/core/src/slice/raw.rs:LL:COL
@@ -35,13 +35,13 @@ LL | &*ptr::slice_from_raw_parts(data, len)
3535
| dereferencing pointer failed: alloc26 has size 4, so pointer to 8 bytes starting at offset 0 is out-of-bounds
3636
| inside `std::slice::from_raw_parts::<u32>` at $SRC_DIR/core/src/slice/raw.rs:LL:COL
3737
|
38-
::: $DIR/forbidden_slices.rs:19:34
38+
::: $DIR/forbidden_slices.rs:20:34
3939
|
4040
LL | pub static S2: &[u32] = unsafe { from_raw_parts(&D0, 2) };
41-
| ---------------------- inside `S2` at $DIR/forbidden_slices.rs:19:34
41+
| ---------------------- inside `S2` at $DIR/forbidden_slices.rs:20:34
4242

4343
error[E0080]: it is undefined behavior to use this value
44-
--> $DIR/forbidden_slices.rs:22:1
44+
--> $DIR/forbidden_slices.rs:23:1
4545
|
4646
LL | pub static S4: &[u8] = unsafe { from_raw_parts((&D1) as *const _ as _, 1) };
4747
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed at .<deref>[0]: encountered uninitialized bytes
@@ -52,7 +52,7 @@ LL | pub static S4: &[u8] = unsafe { from_raw_parts((&D1) as *const _ as _, 1) }
5252
}
5353

5454
error[E0080]: it is undefined behavior to use this value
55-
--> $DIR/forbidden_slices.rs:24:1
55+
--> $DIR/forbidden_slices.rs:25:1
5656
|
5757
LL | pub static S5: &[u8] = unsafe { from_raw_parts((&D3) as *const _ as _, size_of::<&u32>()) };
5858
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed at .<deref>: encountered a pointer, but expected plain (non-pointer) bytes
@@ -63,7 +63,7 @@ LL | pub static S5: &[u8] = unsafe { from_raw_parts((&D3) as *const _ as _, size
6363
}
6464

6565
error[E0080]: it is undefined behavior to use this value
66-
--> $DIR/forbidden_slices.rs:26:1
66+
--> $DIR/forbidden_slices.rs:27:1
6767
|
6868
LL | pub static S6: &[bool] = unsafe { from_raw_parts((&D0) as *const _ as _, 4) };
6969
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed at .<deref>[0]: encountered 0x11, but expected a boolean
@@ -74,7 +74,7 @@ LL | pub static S6: &[bool] = unsafe { from_raw_parts((&D0) as *const _ as _, 4)
7474
}
7575

7676
error[E0080]: it is undefined behavior to use this value
77-
--> $DIR/forbidden_slices.rs:29:1
77+
--> $DIR/forbidden_slices.rs:30:1
7878
|
7979
LL | / pub static S7: &[u16] = unsafe {
8080
LL | |
@@ -98,10 +98,10 @@ LL | &*ptr::slice_from_raw_parts(data, len)
9898
| dereferencing pointer failed: alloc96 has size 8, so pointer to 8 bytes starting at offset 1 is out-of-bounds
9999
| inside `std::slice::from_raw_parts::<u64>` at $SRC_DIR/core/src/slice/raw.rs:LL:COL
100100
|
101-
::: $DIR/forbidden_slices.rs:40:5
101+
::: $DIR/forbidden_slices.rs:41:5
102102
|
103103
LL | from_raw_parts(ptr, 1)
104-
| ---------------------- inside `S8` at $DIR/forbidden_slices.rs:40:5
104+
| ---------------------- inside `S8` at $DIR/forbidden_slices.rs:41:5
105105

106106
error[E0080]: could not evaluate static initializer
107107
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
@@ -117,10 +117,10 @@ LL | unsafe { intrinsics::ptr_offset_from_unsigned(self, origin) }
117117
LL | unsafe { from_raw_parts(range.start, range.end.sub_ptr(range.start)) }
118118
| ------------------------------ inside `from_ptr_range::<u32>` at $SRC_DIR/core/src/slice/raw.rs:LL:COL
119119
|
120-
::: $DIR/forbidden_slices.rs:43:34
120+
::: $DIR/forbidden_slices.rs:44:34
121121
|
122122
LL | pub static R0: &[u32] = unsafe { from_ptr_range(ptr::null()..ptr::null()) };
123-
| ---------------------------------------- inside `R0` at $DIR/forbidden_slices.rs:43:34
123+
| ---------------------------------------- inside `R0` at $DIR/forbidden_slices.rs:44:34
124124

125125
error[E0080]: could not evaluate static initializer
126126
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
@@ -136,10 +136,10 @@ LL | assert!(0 < pointee_size && pointee_size <= isize::MAX as usize);
136136
LL | unsafe { from_raw_parts(range.start, range.end.sub_ptr(range.start)) }
137137
| ------------------------------ inside `from_ptr_range::<()>` at $SRC_DIR/core/src/slice/raw.rs:LL:COL
138138
|
139-
::: $DIR/forbidden_slices.rs:44:33
139+
::: $DIR/forbidden_slices.rs:45:33
140140
|
141141
LL | pub static R1: &[()] = unsafe { from_ptr_range(ptr::null()..ptr::null()) };
142-
| ---------------------------------------- inside `R1` at $DIR/forbidden_slices.rs:44:33
142+
| ---------------------------------------- inside `R1` at $DIR/forbidden_slices.rs:45:33
143143
|
144144
= note: this error originates in the macro `assert` (in Nightly builds, run with -Z macro-backtrace for more info)
145145

@@ -155,13 +155,13 @@ LL | unsafe { intrinsics::offset(self, count) }
155155
LL | unsafe { self.offset(count as isize) }
156156
| --------------------------- inside `ptr::const_ptr::<impl *const u32>::add` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
157157
|
158-
::: $DIR/forbidden_slices.rs:47:25
158+
::: $DIR/forbidden_slices.rs:48:25
159159
|
160160
LL | from_ptr_range(ptr..ptr.add(2))
161-
| ---------- inside `R2` at $DIR/forbidden_slices.rs:47:25
161+
| ---------- inside `R2` at $DIR/forbidden_slices.rs:48:25
162162

163163
error[E0080]: it is undefined behavior to use this value
164-
--> $DIR/forbidden_slices.rs:49:1
164+
--> $DIR/forbidden_slices.rs:50:1
165165
|
166166
LL | / pub static R4: &[u8] = unsafe {
167167
LL | |
@@ -176,7 +176,7 @@ LL | | };
176176
}
177177

178178
error[E0080]: it is undefined behavior to use this value
179-
--> $DIR/forbidden_slices.rs:54:1
179+
--> $DIR/forbidden_slices.rs:55:1
180180
|
181181
LL | / pub static R5: &[u8] = unsafe {
182182
LL | |
@@ -191,7 +191,7 @@ LL | | };
191191
}
192192

193193
error[E0080]: it is undefined behavior to use this value
194-
--> $DIR/forbidden_slices.rs:59:1
194+
--> $DIR/forbidden_slices.rs:60:1
195195
|
196196
LL | / pub static R6: &[bool] = unsafe {
197197
LL | |
@@ -206,7 +206,7 @@ LL | | };
206206
}
207207

208208
error[E0080]: it is undefined behavior to use this value
209-
--> $DIR/forbidden_slices.rs:64:1
209+
--> $DIR/forbidden_slices.rs:65:1
210210
|
211211
LL | / pub static R7: &[u16] = unsafe {
212212
LL | |
@@ -232,10 +232,10 @@ LL | unsafe { intrinsics::offset(self, count) }
232232
LL | unsafe { self.offset(count as isize) }
233233
| --------------------------- inside `ptr::const_ptr::<impl *const u64>::add` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
234234
|
235-
::: $DIR/forbidden_slices.rs:71:25
235+
::: $DIR/forbidden_slices.rs:72:25
236236
|
237237
LL | from_ptr_range(ptr..ptr.add(1))
238-
| ---------- inside `R8` at $DIR/forbidden_slices.rs:71:25
238+
| ---------- inside `R8` at $DIR/forbidden_slices.rs:72:25
239239

240240
error[E0080]: could not evaluate static initializer
241241
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
@@ -251,10 +251,10 @@ LL | unsafe { intrinsics::ptr_offset_from_unsigned(self, origin) }
251251
LL | unsafe { from_raw_parts(range.start, range.end.sub_ptr(range.start)) }
252252
| ------------------------------ inside `from_ptr_range::<u32>` at $SRC_DIR/core/src/slice/raw.rs:LL:COL
253253
|
254-
::: $DIR/forbidden_slices.rs:76:34
254+
::: $DIR/forbidden_slices.rs:77:34
255255
|
256256
LL | pub static R9: &[u32] = unsafe { from_ptr_range(&D0..(&D0 as *const u32).add(1)) };
257-
| ----------------------------------------------- inside `R9` at $DIR/forbidden_slices.rs:76:34
257+
| ----------------------------------------------- inside `R9` at $DIR/forbidden_slices.rs:77:34
258258

259259
error[E0080]: could not evaluate static initializer
260260
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
@@ -270,10 +270,10 @@ LL | unsafe { intrinsics::ptr_offset_from_unsigned(self, origin) }
270270
LL | unsafe { from_raw_parts(range.start, range.end.sub_ptr(range.start)) }
271271
| ------------------------------ inside `from_ptr_range::<u32>` at $SRC_DIR/core/src/slice/raw.rs:LL:COL
272272
|
273-
::: $DIR/forbidden_slices.rs:77:35
273+
::: $DIR/forbidden_slices.rs:78:35
274274
|
275275
LL | pub static R10: &[u32] = unsafe { from_ptr_range(&D0..&D0) };
276-
| ------------------------ inside `R10` at $DIR/forbidden_slices.rs:77:35
276+
| ------------------------ inside `R10` at $DIR/forbidden_slices.rs:78:35
277277

278278
error: aborting due to 18 previous errors
279279

0 commit comments

Comments
 (0)