Skip to content

Commit abe31a9

Browse files
committed
Partially revert 74d53ab
1 parent 74d53ab commit abe31a9

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ LL | pub static R4: &[u8] = unsafe {
164164
|
165165
= 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.
166166
= note: the raw bytes of the constant (size: 16, align: 8) {
167-
╾──────ALLOC_ID───────╼ 01 00 00 00 00 00 00 00 │ ╾──────╼........
167+
╾──────ALLOC_ID───────╼ 01 00 00 00 00 00 00 00 │ ╾──────╼........
168168
}
169169

170170
error[E0080]: it is undefined behavior to use this value

src/test/ui/consts/offset_from_ub.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -40,19 +40,19 @@ error[E0080]: evaluation of constant value failed
4040
--> $DIR/offset_from_ub.rs:53:14
4141
|
4242
LL | unsafe { ptr_offset_from(end_ptr, start_ptr) }
43-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ out-of-bounds offset_from: alloc17 has size 4, so pointer to 10 bytes starting at offset 0 is out-of-bounds
43+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ out-of-bounds offset_from: alloc18 has size 4, so pointer to 10 bytes starting at offset 0 is out-of-bounds
4444

4545
error[E0080]: evaluation of constant value failed
4646
--> $DIR/offset_from_ub.rs:62:14
4747
|
4848
LL | unsafe { ptr_offset_from(start_ptr, end_ptr) }
49-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ out-of-bounds offset_from: alloc20 has size 4, so pointer to 10 bytes starting at offset 0 is out-of-bounds
49+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ out-of-bounds offset_from: alloc21 has size 4, so pointer to 10 bytes starting at offset 0 is out-of-bounds
5050

5151
error[E0080]: evaluation of constant value failed
5252
--> $DIR/offset_from_ub.rs:70:14
5353
|
5454
LL | unsafe { ptr_offset_from(end_ptr, end_ptr) }
55-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ out-of-bounds offset_from: alloc23 has size 4, so pointer at offset 10 is out-of-bounds
55+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ out-of-bounds offset_from: alloc24 has size 4, so pointer at offset 10 is out-of-bounds
5656

5757
error[E0080]: evaluation of constant value failed
5858
--> $DIR/offset_from_ub.rs:79:14

0 commit comments

Comments
 (0)