Skip to content

Commit b30b535

Browse files
committed
Auto merge of #115408 - RalfJung:miri, r=RalfJung
update Miri r? `@ghost`
2 parents 784916c + 873a7a3 commit b30b535

15 files changed

+286
-101
lines changed

src/tools/miri/ci.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ case $HOST_TARGET in
107107
MIRI_TEST_TARGET=i686-unknown-linux-gnu run_tests
108108
MIRI_TEST_TARGET=aarch64-unknown-linux-gnu run_tests
109109
MIRI_TEST_TARGET=aarch64-apple-darwin run_tests
110-
MIRI_TEST_TARGET=i686-pc-windows-msvc run_tests
110+
MIRI_TEST_TARGET=i686-pc-windows-gnu run_tests
111111
MIRI_TEST_TARGET=x86_64-unknown-freebsd run_tests_minimal hello integer vec panic/panic concurrency/simple atomic data_race env/var
112112
MIRI_TEST_TARGET=aarch64-linux-android run_tests_minimal hello integer vec panic/panic
113113
MIRI_TEST_TARGET=wasm32-wasi run_tests_minimal no_std integer strings

src/tools/miri/rust-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
c40cfcf0494ff7506e753e750adb00eeea839f9c
1+
dca2d1ff00bf96d244b1bb9a2117a92ec50ac71d

src/tools/miri/src/diagnostics.rs

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -272,26 +272,24 @@ pub fn report_error<'tcx, 'mir>(
272272
} else {
273273
let title = match e.kind() {
274274
UndefinedBehavior(UndefinedBehaviorInfo::ValidationError(validation_err))
275-
if matches!(validation_err.kind, ValidationErrorKind::PointerAsInt { .. } | ValidationErrorKind::PartialPointer) =>
275+
if matches!(
276+
validation_err.kind,
277+
ValidationErrorKind::PointerAsInt { .. } | ValidationErrorKind::PartialPointer
278+
) =>
276279
{
277280
ecx.handle_ice(); // print interpreter backtrace
278281
bug!("This validation error should be impossible in Miri: {}", ecx.format_error(e));
279282
}
280-
UndefinedBehavior(_) =>
281-
"Undefined Behavior",
282-
ResourceExhaustion(_) =>
283-
"resource exhaustion",
283+
UndefinedBehavior(_) => "Undefined Behavior",
284+
ResourceExhaustion(_) => "resource exhaustion",
284285
Unsupported(
285286
// We list only the ones that can actually happen.
286-
UnsupportedOpInfo::Unsupported(_) | UnsupportedOpInfo::UnsizedLocal
287-
) =>
288-
"unsupported operation",
287+
UnsupportedOpInfo::Unsupported(_) | UnsupportedOpInfo::UnsizedLocal,
288+
) => "unsupported operation",
289289
InvalidProgram(
290290
// We list only the ones that can actually happen.
291-
InvalidProgramInfo::AlreadyReported(_) |
292-
InvalidProgramInfo::Layout(..)
293-
) =>
294-
"post-monomorphization error",
291+
InvalidProgramInfo::AlreadyReported(_) | InvalidProgramInfo::Layout(..),
292+
) => "post-monomorphization error",
295293
_ => {
296294
ecx.handle_ice(); // print interpreter backtrace
297295
bug!("This error should be impossible in Miri: {}", ecx.format_error(e));
@@ -346,7 +344,8 @@ pub fn report_error<'tcx, 'mir>(
346344
extra,
347345
"Uninitialized memory occurred at {alloc_id:?}{range:?}, in this allocation:",
348346
range = access.bad,
349-
).unwrap();
347+
)
348+
.unwrap();
350349
writeln!(extra, "{:?}", ecx.dump_alloc(*alloc_id)).unwrap();
351350
}
352351
_ => {}

src/tools/miri/src/machine.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -975,7 +975,10 @@ impl<'mir, 'tcx> Machine<'mir, 'tcx> for MiriMachine<'mir, 'tcx> {
975975
ecx.start_panic_nounwind(msg)
976976
}
977977

978-
fn unwind_terminate(ecx: &mut InterpCx<'mir, 'tcx, Self>, reason: mir::UnwindTerminateReason) -> InterpResult<'tcx> {
978+
fn unwind_terminate(
979+
ecx: &mut InterpCx<'mir, 'tcx, Self>,
980+
reason: mir::UnwindTerminateReason,
981+
) -> InterpResult<'tcx> {
979982
// Call the lang item.
980983
let panic = ecx.tcx.lang_items().get(reason.lang_item()).unwrap();
981984
let panic = ty::Instance::mono(ecx.tcx.tcx, panic);
@@ -1410,17 +1413,14 @@ impl<'mir, 'tcx> Machine<'mir, 'tcx> for MiriMachine<'mir, 'tcx> {
14101413
ecx: &mut InterpCx<'mir, 'tcx, Self>,
14111414
frame: usize,
14121415
local: mir::Local,
1413-
mplace: &MPlaceTy<'tcx, Provenance>
1416+
mplace: &MPlaceTy<'tcx, Provenance>,
14141417
) -> InterpResult<'tcx> {
14151418
let Some(Provenance::Concrete { alloc_id, .. }) = mplace.ptr.provenance else {
14161419
panic!("after_local_allocated should only be called on fresh allocations");
14171420
};
14181421
let local_decl = &ecx.active_thread_stack()[frame].body.local_decls[local];
14191422
let span = local_decl.source_info.span;
1420-
ecx.machine
1421-
.allocation_spans
1422-
.borrow_mut()
1423-
.insert(alloc_id, (span, None));
1423+
ecx.machine.allocation_spans.borrow_mut().insert(alloc_id, (span, None));
14241424
Ok(())
14251425
}
14261426
}

src/tools/miri/tests/fail/function_calls/exported_symbol_bad_unwind2.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
//@revisions: extern_block definition both
22
//@normalize-stderr-test: "unsafe \{ libc::abort\(\) \}|crate::intrinsics::abort\(\);" -> "ABORT();"
33
//@normalize-stderr-test: "\| +\^+" -> "| ^"
4-
//@normalize-stderr-test: "\n +[0-9]+:[^\n]+" -> "$1"
5-
//@normalize-stderr-test: "\n at [^\n]+" -> "$1"
4+
//@normalize-stderr-test: "\n +[0-9]+:[^\n]+" -> ""
5+
//@normalize-stderr-test: "\n +at [^\n]+" -> ""
66
//@[definition,both]error-in-other-file: aborted execution
77
#![feature(rustc_attrs, c_unwind)]
88

src/tools/miri/tests/fail/intrinsics/uninit_uninhabited_type.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//@normalize-stderr-test: "unsafe \{ libc::abort\(\) \}|crate::intrinsics::abort\(\);" -> "ABORT();"
22
//@normalize-stderr-test: "\| +\^+" -> "| ^"
3-
//@normalize-stderr-test: "\n +[0-9]+:[^\n]+" -> "$1"
4-
//@normalize-stderr-test: "\n at [^\n]+" -> "$1"
3+
//@normalize-stderr-test: "\n +[0-9]+:[^\n]+" -> ""
4+
//@normalize-stderr-test: "\n +at [^\n]+" -> ""
55
//@error-in-other-file: aborted execution
66
#![feature(never_type)]
77

src/tools/miri/tests/fail/intrinsics/zero_fn_ptr.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//@normalize-stderr-test: "unsafe \{ libc::abort\(\) \}|crate::intrinsics::abort\(\);" -> "ABORT();"
22
//@normalize-stderr-test: "\| +\^+" -> "| ^"
3-
//@normalize-stderr-test: "\n +[0-9]+:[^\n]+" -> "$1"
4-
//@normalize-stderr-test: "\n at [^\n]+" -> "$1"
3+
//@normalize-stderr-test: "\n +[0-9]+:[^\n]+" -> ""
4+
//@normalize-stderr-test: "\n +at [^\n]+" -> ""
55
//@error-in-other-file: aborted execution
66

77
#[allow(deprecated, invalid_value)]

src/tools/miri/tests/fail/panic/double_panic.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//@normalize-stderr-test: "unsafe \{ libc::abort\(\) \}|crate::intrinsics::abort\(\);" -> "ABORT();"
22
//@normalize-stderr-test: "\| +\^+" -> "| ^"
3-
//@normalize-stderr-test: "\n +[0-9]+:[^\n]+" -> "$1"
4-
//@normalize-stderr-test: "\n at [^\n]+" -> "$1"
3+
//@normalize-stderr-test: "\n +[0-9]+:[^\n]+" -> ""
4+
//@normalize-stderr-test: "\n +at [^\n]+" -> ""
55
//@error-in-other-file: aborted execution
66

77
struct Foo;

src/tools/miri/tests/fail/terminate-terminator.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
//@compile-flags: -Zmir-opt-level=3 -Zinline-mir-hint-threshold=1000
22
//@normalize-stderr-test: "unsafe \{ libc::abort\(\) \}|crate::intrinsics::abort\(\);" -> "ABORT();"
33
//@normalize-stderr-test: "\| +\^+" -> "| ^"
4-
//@normalize-stderr-test: "\n +[0-9]+:[^\n]+" -> "$1"
5-
//@normalize-stderr-test: "\n at [^\n]+" -> "$1"
4+
//@normalize-stderr-test: "\n +[0-9]+:[^\n]+" -> ""
5+
//@normalize-stderr-test: "\n +at [^\n]+" -> ""
66
//@error-in-other-file: aborted execution
77
// Enable MIR inlining to ensure that `TerminatorKind::UnwindTerminate` is generated
88
// instead of just `UnwindAction::Terminate`.

src/tools/miri/tests/fail/unwind-action-terminate.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
//@error-in-other-file: aborted execution
22
//@normalize-stderr-test: "unsafe \{ libc::abort\(\) \}|crate::intrinsics::abort\(\);" -> "ABORT();"
33
//@normalize-stderr-test: "\| +\^+" -> "| ^"
4-
//@normalize-stderr-test: "\n +[0-9]+:[^\n]+" -> "$1"
5-
//@normalize-stderr-test: "\n at [^\n]+" -> "$1"
4+
//@normalize-stderr-test: "\n +[0-9]+:[^\n]+" -> ""
5+
//@normalize-stderr-test: "\n +at [^\n]+" -> ""
66
#![feature(c_unwind)]
77

88
extern "C" fn panic_abort() {

0 commit comments

Comments
 (0)