Skip to content

Commit a575828

Browse files
RalfJungoli-obk
authored andcommitted
adjust tests
1 parent fa83763 commit a575828

14 files changed

+248
-267
lines changed

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

Lines changed: 27 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ LL | pub static S1: &[()] = unsafe { from_raw_parts(ptr::null(), 0) };
2727
error[E0080]: could not evaluate static initializer
2828
--> $SRC_DIR/core/src/slice/raw.rs:LL:COL
2929
|
30-
= note: dereferencing pointer failed: ALLOC_ID has size 4, so pointer to 8 bytes starting at offset 0 is out-of-bounds
30+
= note: dereferencing pointer failed: allocN has size 4, so pointer to 8 bytes starting at offset 0 is out-of-bounds
3131
|
3232
note: inside `std::slice::from_raw_parts::<'_, u32>`
3333
--> $SRC_DIR/core/src/slice/raw.rs:LL:COL
@@ -45,7 +45,7 @@ LL | pub static S4: &[u8] = unsafe { from_raw_parts((&D1) as *const _ as _, 1) }
4545
|
4646
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
4747
= note: the raw bytes of the constant (size: 8, align: 4) {
48-
ALLOC_ID╼ 01 00 00 00 │ ╾──╼....
48+
╾ALLOC_ID╼ 01 00 00 00 │ ╾──╼....
4949
}
5050

5151
error[E0080]: it is undefined behavior to use this value
@@ -57,7 +57,7 @@ LL | pub static S5: &[u8] = unsafe { from_raw_parts((&D3) as *const _ as _, size
5757
= help: this code performed an operation that depends on the underlying bytes representing a pointer
5858
= help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
5959
= note: the raw bytes of the constant (size: 8, align: 4) {
60-
ALLOC_ID╼ 04 00 00 00 │ ╾──╼....
60+
╾ALLOC_ID╼ 04 00 00 00 │ ╾──╼....
6161
}
6262

6363
error[E0080]: it is undefined behavior to use this value
@@ -68,24 +68,24 @@ LL | pub static S6: &[bool] = unsafe { from_raw_parts((&D0) as *const _ as _, 4)
6868
|
6969
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
7070
= note: the raw bytes of the constant (size: 8, align: 4) {
71-
ALLOC_ID╼ 04 00 00 00 │ ╾──╼....
71+
╾ALLOC_ID╼ 04 00 00 00 │ ╾──╼....
7272
}
7373

7474
error[E0080]: it is undefined behavior to use this value
7575
--> $DIR/forbidden_slices.rs:32:1
7676
|
7777
LL | pub static S7: &[u16] = unsafe {
78-
| ^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered an unaligned reference (required 2 byte alignment but found 1)
78+
| ^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>[1]: encountered uninitialized bytes
7979
|
8080
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
8181
= note: the raw bytes of the constant (size: 8, align: 4) {
82-
─A_ID+0x1─╼ 04 00 00 00 │ ╾──╼....
82+
ALLOC_ID+0x2╼ 04 00 00 00 │ ╾──╼....
8383
}
8484

8585
error[E0080]: could not evaluate static initializer
8686
--> $SRC_DIR/core/src/slice/raw.rs:LL:COL
8787
|
88-
= note: dereferencing pointer failed: ALLOC_ID has size 8, so pointer to 8 bytes starting at offset 1 is out-of-bounds
88+
= note: dereferencing pointer failed: allocN has size 8, so pointer to 8 bytes starting at offset 1 is out-of-bounds
8989
|
9090
note: inside `std::slice::from_raw_parts::<'_, u64>`
9191
--> $SRC_DIR/core/src/slice/raw.rs:LL:COL
@@ -129,7 +129,7 @@ LL | pub static R1: &[()] = unsafe { from_ptr_range(ptr::null()..ptr::null()) };
129129
error[E0080]: could not evaluate static initializer
130130
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
131131
|
132-
= note: out-of-bounds pointer arithmetic: ALLOC_ID has size 4, so pointer to 8 bytes starting at offset 0 is out-of-bounds
132+
= note: out-of-bounds pointer arithmetic: allocN has size 4, so pointer to 8 bytes starting at offset 0 is out-of-bounds
133133
|
134134
note: inside `ptr::const_ptr::<impl *const u32>::offset`
135135
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
@@ -149,7 +149,7 @@ LL | pub static R4: &[u8] = unsafe {
149149
|
150150
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
151151
= note: the raw bytes of the constant (size: 8, align: 4) {
152-
╾ALLOC_ID╼ 01 00 00 00 │ ╾──╼....
152+
╾ALLOC_ID╼ 01 00 00 00 │ ╾──╼....
153153
}
154154

155155
error[E0080]: it is undefined behavior to use this value
@@ -161,7 +161,7 @@ LL | pub static R5: &[u8] = unsafe {
161161
= help: this code performed an operation that depends on the underlying bytes representing a pointer
162162
= help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
163163
= note: the raw bytes of the constant (size: 8, align: 4) {
164-
╾ALLOC_ID╼ 04 00 00 00 │ ╾──╼....
164+
╾ALLOC_ID╼ 04 00 00 00 │ ╾──╼....
165165
}
166166

167167
error[E0080]: it is undefined behavior to use this value
@@ -172,31 +172,35 @@ LL | pub static R6: &[bool] = unsafe {
172172
|
173173
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
174174
= note: the raw bytes of the constant (size: 8, align: 4) {
175-
╾ALLOC_ID╼ 04 00 00 00 │ ╾──╼....
175+
╾ALLOC_ID╼ 04 00 00 00 │ ╾──╼....
176176
}
177177

178-
error[E0080]: it is undefined behavior to use this value
179-
--> $DIR/forbidden_slices.rs:67:1
178+
error[E0080]: could not evaluate static initializer
179+
--> $SRC_DIR/core/src/slice/raw.rs:LL:COL
180180
|
181-
LL | pub static R7: &[u16] = unsafe {
182-
| ^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered an unaligned reference (required 2 byte alignment but found 1)
181+
= note: accessing memory with alignment 1, but alignment 2 is required
183182
|
184-
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
185-
= note: the raw bytes of the constant (size: 8, align: 4) {
186-
╾A_ID+0x1─╼ 04 00 00 00 │ ╾──╼....
187-
}
183+
note: inside `std::slice::from_raw_parts::<'_, u16>`
184+
--> $SRC_DIR/core/src/slice/raw.rs:LL:COL
185+
note: inside `from_ptr_range::<'_, u16>`
186+
--> $SRC_DIR/core/src/slice/raw.rs:LL:COL
187+
note: inside `R7`
188+
--> $DIR/forbidden_slices.rs:69:5
189+
|
190+
LL | from_ptr_range(ptr..ptr.add(4))
191+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
188192

189193
error[E0080]: could not evaluate static initializer
190194
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
191195
|
192-
= note: out-of-bounds pointer arithmetic: ALLOC_ID has size 8, so pointer to 8 bytes starting at offset 1 is out-of-bounds
196+
= note: out-of-bounds pointer arithmetic: allocN has size 8, so pointer to 8 bytes starting at offset 1 is out-of-bounds
193197
|
194198
note: inside `ptr::const_ptr::<impl *const u64>::offset`
195199
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
196200
note: inside `ptr::const_ptr::<impl *const u64>::add`
197201
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
198202
note: inside `R8`
199-
--> $DIR/forbidden_slices.rs:74:25
203+
--> $DIR/forbidden_slices.rs:73:25
200204
|
201205
LL | from_ptr_range(ptr..ptr.add(1))
202206
| ^^^^^^^^^^
@@ -211,7 +215,7 @@ note: inside `ptr::const_ptr::<impl *const u32>::sub_ptr`
211215
note: inside `from_ptr_range::<'_, u32>`
212216
--> $SRC_DIR/core/src/slice/raw.rs:LL:COL
213217
note: inside `R9`
214-
--> $DIR/forbidden_slices.rs:79:34
218+
--> $DIR/forbidden_slices.rs:78:34
215219
|
216220
LL | pub static R9: &[u32] = unsafe { from_ptr_range(&D0..(&D0 as *const u32).add(1)) };
217221
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -226,7 +230,7 @@ note: inside `ptr::const_ptr::<impl *const u32>::sub_ptr`
226230
note: inside `from_ptr_range::<'_, u32>`
227231
--> $SRC_DIR/core/src/slice/raw.rs:LL:COL
228232
note: inside `R10`
229-
--> $DIR/forbidden_slices.rs:80:35
233+
--> $DIR/forbidden_slices.rs:79:35
230234
|
231235
LL | pub static R10: &[u32] = unsafe { from_ptr_range(&D0..&D0) };
232236
| ^^^^^^^^^^^^^^^^^^^^^^^^

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

Lines changed: 29 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ LL | pub static S1: &[()] = unsafe { from_raw_parts(ptr::null(), 0) };
2727
error[E0080]: could not evaluate static initializer
2828
--> $SRC_DIR/core/src/slice/raw.rs:LL:COL
2929
|
30-
= note: dereferencing pointer failed: ALLOC_ID has size 4, so pointer to 8 bytes starting at offset 0 is out-of-bounds
30+
= note: dereferencing pointer failed: allocN has size 4, so pointer to 8 bytes starting at offset 0 is out-of-bounds
3131
|
3232
note: inside `std::slice::from_raw_parts::<'_, u32>`
3333
--> $SRC_DIR/core/src/slice/raw.rs:LL:COL
@@ -45,7 +45,7 @@ LL | pub static S4: &[u8] = unsafe { from_raw_parts((&D1) as *const _ as _, 1) }
4545
|
4646
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
4747
= note: the raw bytes of the constant (size: 16, align: 8) {
48-
───────ALLOC_ID───────╼ 01 00 00 00 00 00 00 00 │ ╾──────╼........
48+
╾ALLOC_ID╼ 01 00 00 00 00 00 00 00 │ ╾──────╼........
4949
}
5050

5151
error[E0080]: it is undefined behavior to use this value
@@ -57,7 +57,7 @@ LL | pub static S5: &[u8] = unsafe { from_raw_parts((&D3) as *const _ as _, size
5757
= help: this code performed an operation that depends on the underlying bytes representing a pointer
5858
= help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
5959
= note: the raw bytes of the constant (size: 16, align: 8) {
60-
───────ALLOC_ID───────╼ 08 00 00 00 00 00 00 00 │ ╾──────╼........
60+
╾ALLOC_ID╼ 08 00 00 00 00 00 00 00 │ ╾──────╼........
6161
}
6262

6363
error[E0080]: it is undefined behavior to use this value
@@ -68,31 +68,29 @@ LL | pub static S6: &[bool] = unsafe { from_raw_parts((&D0) as *const _ as _, 4)
6868
|
6969
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
7070
= note: the raw bytes of the constant (size: 16, align: 8) {
71-
───────ALLOC_ID───────╼ 04 00 00 00 00 00 00 00 │ ╾──────╼........
71+
╾ALLOC_ID╼ 04 00 00 00 00 00 00 00 │ ╾──────╼........
7272
}
7373

74-
error[E0080]: could not evaluate static initializer
75-
--> $SRC_DIR/core/src/slice/raw.rs:LL:COL
74+
error[E0080]: it is undefined behavior to use this value
75+
--> $DIR/forbidden_slices.rs:32:1
7676
|
77-
= note: accessing memory with alignment 1, but alignment 2 is required
77+
LL | pub static S7: &[u16] = unsafe {
78+
| ^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>[1]: encountered uninitialized bytes
7879
|
79-
note: inside `std::slice::from_raw_parts::<'_, u16>`
80-
--> $SRC_DIR/core/src/slice/raw.rs:LL:COL
81-
note: inside `S7`
82-
--> $DIR/forbidden_slices.rs:35:5
83-
|
84-
LL | from_raw_parts(ptr, 4)
85-
| ^^^^^^^^^^^^^^^^^^^^^^
80+
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
81+
= note: the raw bytes of the constant (size: 16, align: 8) {
82+
╾ALLOC_ID+0x2╼ 04 00 00 00 00 00 00 00 │ ╾──────╼........
83+
}
8684

8785
error[E0080]: could not evaluate static initializer
8886
--> $SRC_DIR/core/src/slice/raw.rs:LL:COL
8987
|
90-
= note: dereferencing pointer failed: ALLOC_ID has size 8, so pointer to 8 bytes starting at offset 1 is out-of-bounds
88+
= note: dereferencing pointer failed: allocN has size 8, so pointer to 8 bytes starting at offset 1 is out-of-bounds
9189
|
9290
note: inside `std::slice::from_raw_parts::<'_, u64>`
9391
--> $SRC_DIR/core/src/slice/raw.rs:LL:COL
9492
note: inside `S8`
95-
--> $DIR/forbidden_slices.rs:42:5
93+
--> $DIR/forbidden_slices.rs:43:5
9694
|
9795
LL | from_raw_parts(ptr, 1)
9896
| ^^^^^^^^^^^^^^^^^^^^^^
@@ -107,7 +105,7 @@ note: inside `ptr::const_ptr::<impl *const u32>::sub_ptr`
107105
note: inside `from_ptr_range::<'_, u32>`
108106
--> $SRC_DIR/core/src/slice/raw.rs:LL:COL
109107
note: inside `R0`
110-
--> $DIR/forbidden_slices.rs:45:34
108+
--> $DIR/forbidden_slices.rs:46:34
111109
|
112110
LL | pub static R0: &[u32] = unsafe { from_ptr_range(ptr::null()..ptr::null()) };
113111
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -122,7 +120,7 @@ note: inside `ptr::const_ptr::<impl *const ()>::sub_ptr`
122120
note: inside `from_ptr_range::<'_, ()>`
123121
--> $SRC_DIR/core/src/slice/raw.rs:LL:COL
124122
note: inside `R1`
125-
--> $DIR/forbidden_slices.rs:46:33
123+
--> $DIR/forbidden_slices.rs:47:33
126124
|
127125
LL | pub static R1: &[()] = unsafe { from_ptr_range(ptr::null()..ptr::null()) };
128126
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -131,50 +129,50 @@ LL | pub static R1: &[()] = unsafe { from_ptr_range(ptr::null()..ptr::null()) };
131129
error[E0080]: could not evaluate static initializer
132130
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
133131
|
134-
= note: out-of-bounds pointer arithmetic: ALLOC_ID has size 4, so pointer to 8 bytes starting at offset 0 is out-of-bounds
132+
= note: out-of-bounds pointer arithmetic: allocN has size 4, so pointer to 8 bytes starting at offset 0 is out-of-bounds
135133
|
136134
note: inside `ptr::const_ptr::<impl *const u32>::offset`
137135
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
138136
note: inside `ptr::const_ptr::<impl *const u32>::add`
139137
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
140138
note: inside `R2`
141-
--> $DIR/forbidden_slices.rs:49:25
139+
--> $DIR/forbidden_slices.rs:50:25
142140
|
143141
LL | from_ptr_range(ptr..ptr.add(2))
144142
| ^^^^^^^^^^
145143

146144
error[E0080]: it is undefined behavior to use this value
147-
--> $DIR/forbidden_slices.rs:51:1
145+
--> $DIR/forbidden_slices.rs:52:1
148146
|
149147
LL | pub static R4: &[u8] = unsafe {
150148
| ^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>[0]: encountered uninitialized bytes
151149
|
152150
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
153151
= note: the raw bytes of the constant (size: 16, align: 8) {
154-
──────ALLOC_ID───────╼ 01 00 00 00 00 00 00 00 │ ╾──────╼........
152+
╾ALLOC_ID╼ 01 00 00 00 00 00 00 00 │ ╾──────╼........
155153
}
156154

157155
error[E0080]: it is undefined behavior to use this value
158-
--> $DIR/forbidden_slices.rs:56:1
156+
--> $DIR/forbidden_slices.rs:57:1
159157
|
160158
LL | pub static R5: &[u8] = unsafe {
161159
| ^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
162160
|
163161
= help: this code performed an operation that depends on the underlying bytes representing a pointer
164162
= help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
165163
= note: the raw bytes of the constant (size: 16, align: 8) {
166-
──────ALLOC_ID───────╼ 08 00 00 00 00 00 00 00 │ ╾──────╼........
164+
╾ALLOC_ID╼ 08 00 00 00 00 00 00 00 │ ╾──────╼........
167165
}
168166

169167
error[E0080]: it is undefined behavior to use this value
170-
--> $DIR/forbidden_slices.rs:61:1
168+
--> $DIR/forbidden_slices.rs:62:1
171169
|
172170
LL | pub static R6: &[bool] = unsafe {
173171
| ^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>[0]: encountered 0x11, but expected a boolean
174172
|
175173
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
176174
= note: the raw bytes of the constant (size: 16, align: 8) {
177-
──────ALLOC_ID───────╼ 04 00 00 00 00 00 00 00 │ ╾──────╼........
175+
╾ALLOC_ID╼ 04 00 00 00 00 00 00 00 │ ╾──────╼........
178176
}
179177

180178
error[E0080]: could not evaluate static initializer
@@ -187,22 +185,22 @@ note: inside `std::slice::from_raw_parts::<'_, u16>`
187185
note: inside `from_ptr_range::<'_, u16>`
188186
--> $SRC_DIR/core/src/slice/raw.rs:LL:COL
189187
note: inside `R7`
190-
--> $DIR/forbidden_slices.rs:68:5
188+
--> $DIR/forbidden_slices.rs:69:5
191189
|
192190
LL | from_ptr_range(ptr..ptr.add(4))
193191
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
194192

195193
error[E0080]: could not evaluate static initializer
196194
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
197195
|
198-
= note: out-of-bounds pointer arithmetic: ALLOC_ID has size 8, so pointer to 8 bytes starting at offset 1 is out-of-bounds
196+
= note: out-of-bounds pointer arithmetic: allocN has size 8, so pointer to 8 bytes starting at offset 1 is out-of-bounds
199197
|
200198
note: inside `ptr::const_ptr::<impl *const u64>::offset`
201199
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
202200
note: inside `ptr::const_ptr::<impl *const u64>::add`
203201
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
204202
note: inside `R8`
205-
--> $DIR/forbidden_slices.rs:72:25
203+
--> $DIR/forbidden_slices.rs:73:25
206204
|
207205
LL | from_ptr_range(ptr..ptr.add(1))
208206
| ^^^^^^^^^^
@@ -217,7 +215,7 @@ note: inside `ptr::const_ptr::<impl *const u32>::sub_ptr`
217215
note: inside `from_ptr_range::<'_, u32>`
218216
--> $SRC_DIR/core/src/slice/raw.rs:LL:COL
219217
note: inside `R9`
220-
--> $DIR/forbidden_slices.rs:77:34
218+
--> $DIR/forbidden_slices.rs:78:34
221219
|
222220
LL | pub static R9: &[u32] = unsafe { from_ptr_range(&D0..(&D0 as *const u32).add(1)) };
223221
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -232,7 +230,7 @@ note: inside `ptr::const_ptr::<impl *const u32>::sub_ptr`
232230
note: inside `from_ptr_range::<'_, u32>`
233231
--> $SRC_DIR/core/src/slice/raw.rs:LL:COL
234232
note: inside `R10`
235-
--> $DIR/forbidden_slices.rs:78:35
233+
--> $DIR/forbidden_slices.rs:79:35
236234
|
237235
LL | pub static R10: &[u32] = unsafe { from_ptr_range(&D0..&D0) };
238236
| ^^^^^^^^^^^^^^^^^^^^^^^^

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

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// stderr-per-bitwidth
2-
// normalize-stderr-test "alloc[0-9]+" -> "ALLOC_ID"
3-
// normalize-stderr-test "a[0-9]+\+0x" -> "A_ID+0x"
2+
// normalize-stderr-test "╾─*a(lloc)?[0-9]+(\+[a-z0-9]+)?─*╼" -> "ALLOC_ID$2╼"
3+
// normalize-stderr-test "alloc\d+" -> "allocN"
44
// error-pattern: could not evaluate static initializer
55
#![feature(
66
slice_from_ptr_range,
@@ -30,7 +30,8 @@ pub static S6: &[bool] = unsafe { from_raw_parts((&D0) as *const _ as _, 4) }; /
3030

3131
// Reading padding is not ok
3232
pub static S7: &[u16] = unsafe {
33-
let ptr = (&D2 as *const Struct as *const u16).byte_add(1);
33+
//~^ ERROR: it is undefined behavior to use this value
34+
let ptr = (&D2 as *const Struct as *const u16).add(1);
3435

3536
from_raw_parts(ptr, 4)
3637
};
@@ -65,11 +66,11 @@ pub static R6: &[bool] = unsafe {
6566
};
6667
pub static R7: &[u16] = unsafe {
6768
let ptr = (&D2 as *const Struct as *const u16).byte_add(1);
68-
from_ptr_range(ptr..ptr.add(4))
69+
from_ptr_range(ptr..ptr.add(4)) //~ inside `R7`
6970
};
7071
pub static R8: &[u64] = unsafe {
7172
let ptr = (&D4 as *const [u32; 2] as *const u32).byte_add(1).cast::<u64>();
72-
from_ptr_range(ptr..ptr.add(1))
73+
from_ptr_range(ptr..ptr.add(1)) //~ inside `R8`
7374
};
7475

7576
// This is sneaky: &D0 and &D0 point to different objects

0 commit comments

Comments
 (0)