Skip to content

Commit cde87d1

Browse files
committed
Auto merge of #2345 - RalfJung:rustup, r=RalfJung
rustup
2 parents 622963a + 23d1f1a commit cde87d1

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

rust-version

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
8824d131619e58a38bde8bcf56401629b91a204a
1+
1517f5de01c445b5124b30f02257b02b4c5ef3b2

src/diagnostics.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -291,8 +291,8 @@ pub fn report_error<'tcx, 'mir>(
291291
match e.kind() {
292292
UndefinedBehavior(UndefinedBehaviorInfo::InvalidUninitBytes(Some((alloc_id, access)))) => {
293293
eprintln!(
294-
"Uninitialized read occurred at {alloc_id:?}{range:?}, in this allocation:",
295-
range = alloc_range(access.uninit_offset, access.uninit_size),
294+
"Uninitialized memory occurred at {alloc_id:?}{range:?}, in this allocation:",
295+
range = access.uninit,
296296
);
297297
eprintln!("{:?}", ecx.dump_alloc(*alloc_id));
298298
}

tests/fail/uninit_buffer.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// error-pattern: 12 bytes are uninitialized
1+
// error-pattern: memory is uninitialized at [0x4..0x10]
22

33
use std::alloc::{alloc, dealloc, Layout};
44
use std::slice::from_raw_parts;

tests/fail/uninit_buffer.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
error: Undefined Behavior: reading 16 bytes of memory starting at ALLOC, but 12 bytes are uninitialized starting at ALLOC+0x4, and this operation requires initialized memory
1+
error: Undefined Behavior: reading memory at ALLOC[0x0..0x10], but memory is uninitialized at [0x4..0x10], and this operation requires initialized memory
22
--> RUSTLIB/core/src/slice/cmp.rs:LL:CC
33
|
44
LL | let mut order = unsafe { memcmp(left.as_ptr(), right.as_ptr(), len) as isize };
5-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ reading 16 bytes of memory starting at ALLOC, but 12 bytes are uninitialized starting at ALLOC+0x4, and this operation requires initialized memory
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ reading memory at ALLOC[0x0..0x10], but memory is uninitialized at [0x4..0x10], and this operation requires initialized memory
66
|
77
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
88
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
@@ -17,7 +17,7 @@ LL | drop(slice1.cmp(slice2));
1717

1818
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
1919

20-
Uninitialized read occurred at ALLOC[0x4..0x10], in this allocation:
20+
Uninitialized memory occurred at ALLOC[0x4..0x10], in this allocation:
2121
ALLOC (Rust heap, size: 32, align: 8) {
2222
0x00 │ 41 42 43 44 __ __ __ __ __ __ __ __ __ __ __ __ │ ABCD░░░░░░░░░░░░
2323
0x10 │ 00 __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ │ .░░░░░░░░░░░░░░░

0 commit comments

Comments
 (0)