File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff 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
170170error[E0080]: it is undefined behavior to use this value
Original file line number Diff line number Diff line change @@ -40,19 +40,19 @@ error[E0080]: evaluation of constant value failed
4040 --> $DIR/offset_from_ub.rs:53:14
4141 |
4242LL | 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
4545error[E0080]: evaluation of constant value failed
4646 --> $DIR/offset_from_ub.rs:62:14
4747 |
4848LL | 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
5151error[E0080]: evaluation of constant value failed
5252 --> $DIR/offset_from_ub.rs:70:14
5353 |
5454LL | 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
5757error[E0080]: evaluation of constant value failed
5858 --> $DIR/offset_from_ub.rs:79:14
You can’t perform that action at this time.
0 commit comments