1
1
error[E0080]: it is undefined behavior to use this value
2
- --> $DIR/forbidden_slices.rs:18 :1
2
+ --> $DIR/forbidden_slices.rs:16 :1
3
3
|
4
4
LL | pub static S0: &[u32] = unsafe { from_raw_parts(ptr::null(), 0) };
5
5
| ^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a null reference
@@ -10,7 +10,7 @@ LL | pub static S0: &[u32] = unsafe { from_raw_parts(ptr::null(), 0) };
10
10
}
11
11
12
12
error[E0080]: it is undefined behavior to use this value
13
- --> $DIR/forbidden_slices.rs:20 :1
13
+ --> $DIR/forbidden_slices.rs:18 :1
14
14
|
15
15
LL | pub static S1: &[()] = unsafe { from_raw_parts(ptr::null(), 0) };
16
16
| ^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a null reference
@@ -21,7 +21,7 @@ LL | pub static S1: &[()] = unsafe { from_raw_parts(ptr::null(), 0) };
21
21
}
22
22
23
23
error[E0080]: it is undefined behavior to use this value
24
- --> $DIR/forbidden_slices.rs:24 :1
24
+ --> $DIR/forbidden_slices.rs:22 :1
25
25
|
26
26
LL | pub static S2: &[u32] = unsafe { from_raw_parts(&D0, 2) };
27
27
| ^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a dangling reference (going beyond the bounds of its allocation)
@@ -32,7 +32,7 @@ LL | pub static S2: &[u32] = unsafe { from_raw_parts(&D0, 2) };
32
32
}
33
33
34
34
error[E0080]: it is undefined behavior to use this value
35
- --> $DIR/forbidden_slices.rs:28 :1
35
+ --> $DIR/forbidden_slices.rs:26 :1
36
36
|
37
37
LL | pub static S4: &[u8] = unsafe { from_raw_parts((&D1) as *const _ as _, 1) };
38
38
| ^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>[0]: encountered uninitialized memory, but expected an integer
@@ -43,7 +43,7 @@ LL | pub static S4: &[u8] = unsafe { from_raw_parts((&D1) as *const _ as _, 1) }
43
43
}
44
44
45
45
error[E0080]: it is undefined behavior to use this value
46
- --> $DIR/forbidden_slices.rs:30 :1
46
+ --> $DIR/forbidden_slices.rs:28 :1
47
47
|
48
48
LL | pub static S5: &[u8] = unsafe { from_raw_parts((&D3) as *const _ as _, size_of::<&u32>()) };
49
49
| ^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>[0]: encountered a pointer, but expected an integer
@@ -56,7 +56,7 @@ LL | pub static S5: &[u8] = unsafe { from_raw_parts((&D3) as *const _ as _, size
56
56
= help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
57
57
58
58
error[E0080]: it is undefined behavior to use this value
59
- --> $DIR/forbidden_slices.rs:32 :1
59
+ --> $DIR/forbidden_slices.rs:30 :1
60
60
|
61
61
LL | pub static S6: &[bool] = unsafe { from_raw_parts((&D0) as *const _ as _, 4) };
62
62
| ^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>[0]: encountered 0x11, but expected a boolean
@@ -67,7 +67,7 @@ LL | pub static S6: &[bool] = unsafe { from_raw_parts((&D0) as *const _ as _, 4)
67
67
}
68
68
69
69
error[E0080]: it is undefined behavior to use this value
70
- --> $DIR/forbidden_slices.rs:35 :1
70
+ --> $DIR/forbidden_slices.rs:33 :1
71
71
|
72
72
LL | pub static S7: &[u16] = unsafe {
73
73
| ^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>[1]: encountered uninitialized memory, but expected an integer
@@ -78,7 +78,7 @@ LL | pub static S7: &[u16] = unsafe {
78
78
}
79
79
80
80
error[E0080]: it is undefined behavior to use this value
81
- --> $DIR/forbidden_slices.rs:43 :1
81
+ --> $DIR/forbidden_slices.rs:41 :1
82
82
|
83
83
LL | pub static S8: &[u64] = unsafe {
84
84
| ^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a dangling reference (going beyond the bounds of its allocation)
@@ -98,7 +98,7 @@ note: inside `ptr::const_ptr::<impl *const u32>::sub_ptr`
98
98
note: inside `from_ptr_range::<'_, u32>`
99
99
--> $SRC_DIR/core/src/slice/raw.rs:LL:COL
100
100
note: inside `R0`
101
- --> $DIR/forbidden_slices.rs:50 :34
101
+ --> $DIR/forbidden_slices.rs:48 :34
102
102
|
103
103
LL | pub static R0: &[u32] = unsafe { from_ptr_range(ptr::null()..ptr::null()) };
104
104
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -113,7 +113,7 @@ note: inside `ptr::const_ptr::<impl *const ()>::sub_ptr`
113
113
note: inside `from_ptr_range::<'_, ()>`
114
114
--> $SRC_DIR/core/src/slice/raw.rs:LL:COL
115
115
note: inside `R1`
116
- --> $DIR/forbidden_slices.rs:51 :33
116
+ --> $DIR/forbidden_slices.rs:49 :33
117
117
|
118
118
LL | pub static R1: &[()] = unsafe { from_ptr_range(ptr::null()..ptr::null()) };
119
119
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -127,13 +127,13 @@ error[E0080]: could not evaluate static initializer
127
127
note: inside `ptr::const_ptr::<impl *const u32>::add`
128
128
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
129
129
note: inside `R2`
130
- --> $DIR/forbidden_slices.rs:54 :25
130
+ --> $DIR/forbidden_slices.rs:52 :25
131
131
|
132
132
LL | from_ptr_range(ptr..ptr.add(2))
133
133
| ^^^^^^^^^^
134
134
135
135
error[E0080]: it is undefined behavior to use this value
136
- --> $DIR/forbidden_slices.rs:56 :1
136
+ --> $DIR/forbidden_slices.rs:54 :1
137
137
|
138
138
LL | pub static R4: &[u8] = unsafe {
139
139
| ^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>[0]: encountered uninitialized memory, but expected an integer
@@ -144,7 +144,7 @@ LL | pub static R4: &[u8] = unsafe {
144
144
}
145
145
146
146
error[E0080]: it is undefined behavior to use this value
147
- --> $DIR/forbidden_slices.rs:61 :1
147
+ --> $DIR/forbidden_slices.rs:59 :1
148
148
|
149
149
LL | pub static R5: &[u8] = unsafe {
150
150
| ^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>[0]: encountered a pointer, but expected an integer
@@ -157,7 +157,7 @@ LL | pub static R5: &[u8] = unsafe {
157
157
= help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
158
158
159
159
error[E0080]: it is undefined behavior to use this value
160
- --> $DIR/forbidden_slices.rs:66 :1
160
+ --> $DIR/forbidden_slices.rs:64 :1
161
161
|
162
162
LL | pub static R6: &[bool] = unsafe {
163
163
| ^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>[0]: encountered 0x11, but expected a boolean
@@ -168,7 +168,7 @@ LL | pub static R6: &[bool] = unsafe {
168
168
}
169
169
170
170
error[E0080]: it is undefined behavior to use this value
171
- --> $DIR/forbidden_slices.rs:71 :1
171
+ --> $DIR/forbidden_slices.rs:69 :1
172
172
|
173
173
LL | pub static R7: &[u16] = unsafe {
174
174
| ^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered an unaligned reference (required 2 byte alignment but found 1)
@@ -186,7 +186,7 @@ error[E0080]: could not evaluate static initializer
186
186
note: inside `ptr::const_ptr::<impl *const u64>::add`
187
187
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
188
188
note: inside `R8`
189
- --> $DIR/forbidden_slices.rs:78 :25
189
+ --> $DIR/forbidden_slices.rs:76 :25
190
190
|
191
191
LL | from_ptr_range(ptr..ptr.add(1))
192
192
| ^^^^^^^^^^
@@ -201,7 +201,7 @@ note: inside `ptr::const_ptr::<impl *const u32>::sub_ptr`
201
201
note: inside `from_ptr_range::<'_, u32>`
202
202
--> $SRC_DIR/core/src/slice/raw.rs:LL:COL
203
203
note: inside `R9`
204
- --> $DIR/forbidden_slices.rs:83 :34
204
+ --> $DIR/forbidden_slices.rs:81 :34
205
205
|
206
206
LL | pub static R9: &[u32] = unsafe { from_ptr_range(&D0..(&D0 as *const u32).add(1)) };
207
207
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -216,7 +216,7 @@ note: inside `ptr::const_ptr::<impl *const u32>::sub_ptr`
216
216
note: inside `from_ptr_range::<'_, u32>`
217
217
--> $SRC_DIR/core/src/slice/raw.rs:LL:COL
218
218
note: inside `R10`
219
- --> $DIR/forbidden_slices.rs:84 :35
219
+ --> $DIR/forbidden_slices.rs:82 :35
220
220
|
221
221
LL | pub static R10: &[u32] = unsafe { from_ptr_range(&D0..&D0) };
222
222
| ^^^^^^^^^^^^^^^^^^^^^^^^
0 commit comments