11error[E0080]: constructing invalid value: encountered a null reference
2- --> $DIR/forbidden_slices.rs:16 :1
2+ --> $DIR/forbidden_slices.rs:17 :1
33 |
44LL | pub static S0: &[u32] = unsafe { from_raw_parts(ptr::null(), 0) };
55 | ^^^^^^^^^^^^^^^^^^^^^ it is undefined behavior to use this value
@@ -10,7 +10,7 @@ LL | pub static S0: &[u32] = unsafe { from_raw_parts(ptr::null(), 0) };
1010 }
1111
1212error[E0080]: constructing invalid value: encountered a null reference
13- --> $DIR/forbidden_slices.rs:18 :1
13+ --> $DIR/forbidden_slices.rs:19 :1
1414 |
1515LL | pub static S1: &[()] = unsafe { from_raw_parts(ptr::null(), 0) };
1616 | ^^^^^^^^^^^^^^^^^^^^ it is undefined behavior to use this value
@@ -21,7 +21,7 @@ LL | pub static S1: &[()] = unsafe { from_raw_parts(ptr::null(), 0) };
2121 }
2222
2323error[E0080]: constructing invalid value: encountered a dangling reference (going beyond the bounds of its allocation)
24- --> $DIR/forbidden_slices.rs:22 :1
24+ --> $DIR/forbidden_slices.rs:23 :1
2525 |
2626LL | pub static S2: &[u32] = unsafe { from_raw_parts(&D0, 2) };
2727 | ^^^^^^^^^^^^^^^^^^^^^ it is undefined behavior to use this value
@@ -32,7 +32,7 @@ LL | pub static S2: &[u32] = unsafe { from_raw_parts(&D0, 2) };
3232 }
3333
3434error[E0080]: constructing invalid value at .<deref>[0]: encountered uninitialized memory, but expected an integer
35- --> $DIR/forbidden_slices.rs:26 :1
35+ --> $DIR/forbidden_slices.rs:27 :1
3636 |
3737LL | pub static S4: &[u8] = unsafe { from_raw_parts((&D1) as *const _ as _, 1) };
3838 | ^^^^^^^^^^^^^^^^^^^^ it is undefined behavior to use this value
@@ -43,7 +43,7 @@ LL | pub static S4: &[u8] = unsafe { from_raw_parts((&D1) as *const _ as _, 1) }
4343 }
4444
4545error[E0080]: constructing invalid value at .<deref>[0]: encountered a pointer, but expected an integer
46- --> $DIR/forbidden_slices.rs:28 :1
46+ --> $DIR/forbidden_slices.rs:29 :1
4747 |
4848LL | pub static S5: &[u8] = unsafe { from_raw_parts((&D3) as *const _ as _, size_of::<&u32>()) };
4949 | ^^^^^^^^^^^^^^^^^^^^ it is undefined behavior to use this value
@@ -56,7 +56,7 @@ LL | pub static S5: &[u8] = unsafe { from_raw_parts((&D3) as *const _ as _, size
5656 }
5757
5858error[E0080]: constructing invalid value at .<deref>[0]: encountered 0x11, but expected a boolean
59- --> $DIR/forbidden_slices.rs:30 :1
59+ --> $DIR/forbidden_slices.rs:31 :1
6060 |
6161LL | pub static S6: &[bool] = unsafe { from_raw_parts((&D0) as *const _ as _, 4) };
6262 | ^^^^^^^^^^^^^^^^^^^^^^ it is undefined behavior to use this value
@@ -67,7 +67,7 @@ LL | pub static S6: &[bool] = unsafe { from_raw_parts((&D0) as *const _ as _, 4)
6767 }
6868
6969error[E0080]: constructing invalid value at .<deref>[1]: encountered uninitialized memory, but expected an integer
70- --> $DIR/forbidden_slices.rs:33 :1
70+ --> $DIR/forbidden_slices.rs:34 :1
7171 |
7272LL | pub static S7: &[u16] = unsafe {
7373 | ^^^^^^^^^^^^^^^^^^^^^ it is undefined behavior to use this value
@@ -78,7 +78,7 @@ LL | pub static S7: &[u16] = unsafe {
7878 }
7979
8080error[E0080]: constructing invalid value: encountered a dangling reference (going beyond the bounds of its allocation)
81- --> $DIR/forbidden_slices.rs:41 :1
81+ --> $DIR/forbidden_slices.rs:42 :1
8282 |
8383LL | pub static S8: &[u64] = unsafe {
8484 | ^^^^^^^^^^^^^^^^^^^^^ it is undefined behavior to use this value
@@ -89,7 +89,7 @@ LL | pub static S8: &[u64] = unsafe {
8989 }
9090
9191error[E0080]: constructing invalid value: encountered a null reference
92- --> $DIR/forbidden_slices.rs:48 :1
92+ --> $DIR/forbidden_slices.rs:49 :1
9393 |
9494LL | pub static R0: &[u32] = unsafe { from_ptr_range(ptr::null()..ptr::null()) };
9595 | ^^^^^^^^^^^^^^^^^^^^^ it is undefined behavior to use this value
@@ -100,19 +100,19 @@ LL | pub static R0: &[u32] = unsafe { from_ptr_range(ptr::null()..ptr::null()) }
100100 }
101101
102102error[E0080]: evaluation panicked: assertion failed: 0 < pointee_size && pointee_size <= isize::MAX as usize
103- --> $DIR/forbidden_slices.rs:50 :33
103+ --> $DIR/forbidden_slices.rs:51 :33
104104 |
105105LL | pub static R1: &[()] = unsafe { from_ptr_range(ptr::null()..ptr::null()) }; // errors inside libcore
106106 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ evaluation of `R1` failed here
107107
108108error[E0080]: in-bounds pointer arithmetic failed: attempting to offset pointer by 8 bytes, but got ALLOC10 which is only 4 bytes from the end of the allocation
109- --> $DIR/forbidden_slices.rs:54 :25
109+ --> $DIR/forbidden_slices.rs:55 :25
110110 |
111111LL | from_ptr_range(ptr..ptr.add(2)) // errors inside libcore
112112 | ^^^^^^^^^^ evaluation of `R2` failed here
113113
114114error[E0080]: constructing invalid value at .<deref>[0]: encountered uninitialized memory, but expected an integer
115- --> $DIR/forbidden_slices.rs:57 :1
115+ --> $DIR/forbidden_slices.rs:58 :1
116116 |
117117LL | pub static R4: &[u8] = unsafe {
118118 | ^^^^^^^^^^^^^^^^^^^^ it is undefined behavior to use this value
@@ -123,7 +123,7 @@ LL | pub static R4: &[u8] = unsafe {
123123 }
124124
125125error[E0080]: constructing invalid value at .<deref>[0]: encountered a pointer, but expected an integer
126- --> $DIR/forbidden_slices.rs:62 :1
126+ --> $DIR/forbidden_slices.rs:63 :1
127127 |
128128LL | pub static R5: &[u8] = unsafe {
129129 | ^^^^^^^^^^^^^^^^^^^^ it is undefined behavior to use this value
@@ -136,7 +136,7 @@ LL | pub static R5: &[u8] = unsafe {
136136 }
137137
138138error[E0080]: constructing invalid value at .<deref>[0]: encountered 0x11, but expected a boolean
139- --> $DIR/forbidden_slices.rs:67 :1
139+ --> $DIR/forbidden_slices.rs:68 :1
140140 |
141141LL | pub static R6: &[bool] = unsafe {
142142 | ^^^^^^^^^^^^^^^^^^^^^^ it is undefined behavior to use this value
@@ -147,7 +147,7 @@ LL | pub static R6: &[bool] = unsafe {
147147 }
148148
149149error[E0080]: constructing invalid value: encountered an unaligned reference (required 2 byte alignment but found 1)
150- --> $DIR/forbidden_slices.rs:72 :1
150+ --> $DIR/forbidden_slices.rs:73 :1
151151 |
152152LL | pub static R7: &[u16] = unsafe {
153153 | ^^^^^^^^^^^^^^^^^^^^^ it is undefined behavior to use this value
@@ -158,19 +158,19 @@ LL | pub static R7: &[u16] = unsafe {
158158 }
159159
160160error[E0080]: in-bounds pointer arithmetic failed: attempting to offset pointer by 8 bytes, but got ALLOC11+0x1 which is only 7 bytes from the end of the allocation
161- --> $DIR/forbidden_slices.rs:79 :25
161+ --> $DIR/forbidden_slices.rs:80 :25
162162 |
163163LL | from_ptr_range(ptr..ptr.add(1))
164164 | ^^^^^^^^^^ evaluation of `R8` failed here
165165
166166error[E0080]: `ptr_offset_from_unsigned` called on two different pointers that are not both derived from the same allocation
167- --> $DIR/forbidden_slices.rs:85 :34
167+ --> $DIR/forbidden_slices.rs:86 :34
168168 |
169169LL | pub static R9: &[u32] = unsafe { from_ptr_range(&D0..(&D0 as *const u32).add(1)) };
170170 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ evaluation of `R9` failed here
171171
172172error[E0080]: `ptr_offset_from_unsigned` called on two different pointers that are not both derived from the same allocation
173- --> $DIR/forbidden_slices.rs:87 :35
173+ --> $DIR/forbidden_slices.rs:88 :35
174174 |
175175LL | pub static R10: &[u32] = unsafe { from_ptr_range(&D0..&D0) };
176176 | ^^^^^^^^^^^^^^^^^^^^^^^^ evaluation of `R10` failed here
0 commit comments