Skip to content

deduplicate abort implementations #139103

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

joboet
Copy link
Member

@joboet joboet commented Mar 29, 2025

Currently, the code for process aborts is duplicated across panic_abort and std. This PR uses #[rustc_std_internal_symbol] to make the std implementation available to panic_abort via the linker, thereby deduplicating the code.

Currently, the code for process aborts is duplicated across `panic_abort` and `std`. This PR uses `#[rustc_std_internal_symbol]` to make the `std` implementation available to `panic_abort` via the linker, thereby deduplicating the code.
@rustbot
Copy link
Collaborator

rustbot commented Mar 29, 2025

r? @tgross35

rustbot has assigned @tgross35.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added O-hermit Operating System: Hermit O-SGX Target: SGX O-windows Operating system: Windows S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Mar 29, 2025
@rustbot
Copy link
Collaborator

rustbot commented Mar 29, 2025

These commits modify the library/Cargo.lock file. Unintentional changes to library/Cargo.lock can be introduced when switching branches and rebasing PRs.

If this was unintentional then you should revert the changes before this PR is merged.
Otherwise, you can ignore this comment.

@rust-log-analyzer

This comment has been minimized.

@rustbot
Copy link
Collaborator

rustbot commented Mar 29, 2025

The Miri subtree was changed

cc @rust-lang/miri

@rust-log-analyzer
Copy link
Collaborator

The job x86_64-gnu-tools failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
tests/fail/function_calls/exported_symbol_bad_unwind2.rs (revision `definition`) ... FAILED
tests/fail/function_calls/exported_symbol_bad_unwind2.rs (revision `both`) ... FAILED

FAILED TEST: tests/fail/alloc/alloc_error_handler.rs
command: MIRI_ENV_VAR_TEST="0" MIRI_TEMP="/tmp/miri-uitest-tA8NtK" RUST_BACKTRACE="1" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/miri" "--error-format=json" "--sysroot=/checkout/obj/build/x86_64-unknown-linux-gnu/miri-sysroot" "-Dwarnings" "-Dunused" "-Ainternal_features" "-Zui-testing" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-tools/miri_ui/0/tests/fail/alloc" "tests/fail/alloc/alloc_error_handler.rs" "--edition" "2021" "--target" "i686-pc-windows-msvc"

error: actual output differed from expected
Execute `./miri test --bless` to update `tests/fail/alloc/alloc_error_handler.stderr` to the actual output
--- tests/fail/alloc/alloc_error_handler.stderr
+++ <stderr output>
---
   |
   = note: BACKTRACE:
   = note: inside `std::sys::pal::windows::abort_internal` at /checkout/library/std/src/sys/pal/windows/mod.rs:359:5: 359:31
   = note: inside `std::process::abort` at /checkout/library/std/src/process.rs:2425:5: 2425:33
   = note: inside `std::alloc::rust_oom` at /checkout/library/std/src/alloc.rs:377:5: 377:28
   = note: inside `std::alloc::_::__rg_oom` at /checkout/library/std/src/alloc.rs:372:1: 372:37
   = note: inside `std::alloc::handle_alloc_error::rt_error` at /checkout/library/alloc/src/alloc.rs:405:13: 405:70
   = note: inside `std::alloc::handle_alloc_error` at /checkout/library/alloc/src/alloc.rs:411:9: 411:75
note: inside `main`
  --> tests/fail/alloc/alloc_error_handler.rs:9:5
   |
LL |     handle_alloc_error(Layout::for_value(&0));
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

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

error: aborting due to 1 previous error
---
   |
   = note: BACKTRACE:
   = note: inside `std::sys::pal::windows::abort_internal` at /checkout/library/std/src/sys/pal/windows/mod.rs:359:5: 359:31
   = note: inside `std::process::abort` at /checkout/library/std/src/process.rs:2425:5: 2425:33
   = note: inside `std::alloc::rust_oom` at /checkout/library/std/src/alloc.rs:377:5: 377:28
   = note: inside `std::alloc::_::__rg_oom` at /checkout/library/std/src/alloc.rs:372:1: 372:37
   = note: inside `std::alloc::handle_alloc_error::rt_error` at /checkout/library/alloc/src/alloc.rs:405:13: 405:70
   = note: inside `std::alloc::handle_alloc_error` at /checkout/library/alloc/src/alloc.rs:411:9: 411:75
note: inside `main`
  --> tests/fail/alloc/alloc_error_handler.rs:9:5
   |
LL |     handle_alloc_error(Layout::for_value(&0));
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

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

error: aborting due to 1 previous error


full stdout:



FAILED TEST: tests/fail/ptr_swap_nonoverlapping.rs
command: MIRI_ENV_VAR_TEST="0" MIRI_TEMP="/tmp/miri-uitest-tA8NtK" RUST_BACKTRACE="1" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/miri" "--error-format=json" "--sysroot=/checkout/obj/build/x86_64-unknown-linux-gnu/miri-sysroot" "-Dwarnings" "-Dunused" "-Ainternal_features" "-Zui-testing" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-tools/miri_ui/0/tests/fail" "tests/fail/ptr_swap_nonoverlapping.rs" "--edition" "2021" "--target" "i686-pc-windows-msvc"

error: actual output differed from expected
Execute `./miri test --bless` to update `tests/fail/ptr_swap_nonoverlapping.stderr` to the actual output
--- tests/fail/ptr_swap_nonoverlapping.stderr
+++ <stderr output>
---

Full unnormalized output:

thread 'main' panicked at /checkout/library/core/src/panicking.rs:218:5:
unsafe precondition(s) violated: ptr::swap_nonoverlapping requires that both pointer arguments are aligned and non-null and the specified memory ranges do not overlap

This indicates a bug in the program. This Undefined Behavior check is optional, and cannot be relied on for safety.
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
thread caused non-unwinding panic. aborting.
error: abnormal termination: the program aborted execution
##[error]  --> /checkout/library/std/src/sys/pal/windows/mod.rs:359:5
   |
LL |     crate::intrinsics::abort()
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^ the program aborted execution
   |
   = note: BACKTRACE:
   = note: inside `std::sys::pal::windows::abort_internal` at /checkout/library/std/src/sys/pal/windows/mod.rs:359:5: 359:31
   = note: inside `std::panicking::rust_panic_with_hook` at /checkout/library/std/src/panicking.rs:855:9: 855:37
   = note: inside closure at /checkout/library/std/src/panicking.rs:699:13: 704:14
   = note: inside `std::sys::backtrace::__rust_end_short_backtrace::<{closure@std::panicking::begin_panic_handler::{closure#0}}, !>` at /checkout/library/std/src/sys/backtrace.rs:168:18: 168:21
   = note: inside `std::panicking::begin_panic_handler` at /checkout/library/std/src/panicking.rs:697:5: 713:7
   = note: inside `core::panicking::panic_nounwind` at /checkout/library/core/src/panicking.rs:218:5: 218:91
   = note: inside `std::ptr::swap_nonoverlapping::precondition_check` at /checkout/library/core/src/ub_checks.rs:68:21: 70:106
   = note: inside `std::ptr::swap_nonoverlapping::<usize>` at /checkout/library/core/src/ub_checks.rs:75:17: 75:46
note: inside `main`
---

full stderr:

thread 'main' panicked at /checkout/library/core/src/panicking.rs:218:5:
unsafe precondition(s) violated: ptr::swap_nonoverlapping requires that both pointer arguments are aligned and non-null and the specified memory ranges do not overlap

This indicates a bug in the program. This Undefined Behavior check is optional, and cannot be relied on for safety.
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
thread caused non-unwinding panic. aborting.
error: abnormal termination: the program aborted execution
##[error]  --> /checkout/library/std/src/sys/pal/windows/mod.rs:359:5
   |
LL |     crate::intrinsics::abort()
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^ the program aborted execution
   |
   = note: BACKTRACE:
   = note: inside `std::sys::pal::windows::abort_internal` at /checkout/library/std/src/sys/pal/windows/mod.rs:359:5: 359:31
   = note: inside `std::panicking::rust_panic_with_hook` at /checkout/library/std/src/panicking.rs:855:9: 855:37
   = note: inside closure at /checkout/library/std/src/panicking.rs:699:13: 704:14
   = note: inside `std::sys::backtrace::__rust_end_short_backtrace::<{closure@std::panicking::begin_panic_handler::{closure#0}}, !>` at /checkout/library/std/src/sys/backtrace.rs:168:18: 168:21
   = note: inside `std::panicking::begin_panic_handler` at /checkout/library/std/src/panicking.rs:697:5: 713:7
   = note: inside `core::panicking::panic_nounwind` at /checkout/library/core/src/panicking.rs:218:5: 218:91
   = note: inside `std::ptr::swap_nonoverlapping::precondition_check` at /checkout/library/core/src/ub_checks.rs:68:21: 70:106
   = note: inside `std::ptr::swap_nonoverlapping::<usize>` at /checkout/library/core/src/ub_checks.rs:75:17: 75:46
note: inside `main`
---



FAILED TEST: tests/fail/intrinsics/zero_fn_ptr.rs
command: MIRI_ENV_VAR_TEST="0" MIRI_TEMP="/tmp/miri-uitest-tA8NtK" RUST_BACKTRACE="1" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/miri" "--error-format=json" "--sysroot=/checkout/obj/build/x86_64-unknown-linux-gnu/miri-sysroot" "-Dwarnings" "-Dunused" "-Ainternal_features" "-Zui-testing" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-tools/miri_ui/0/tests/fail/intrinsics" "tests/fail/intrinsics/zero_fn_ptr.rs" "--edition" "2021" "--target" "i686-pc-windows-msvc"

error: actual output differed from expected
Execute `./miri test --bless` to update `tests/fail/intrinsics/zero_fn_ptr.stderr` to the actual output
--- tests/fail/intrinsics/zero_fn_ptr.stderr
+++ <stderr output>
---

thread 'main' panicked at /checkout/library/core/src/panicking.rs:218:5:
aborted execution: attempted to zero-initialize type `fn()`, which is invalid
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
thread caused non-unwinding panic. aborting.
error: abnormal termination: the program aborted execution
##[error]  --> /checkout/library/std/src/sys/pal/windows/mod.rs:359:5
   |
LL |     crate::intrinsics::abort()
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^ the program aborted execution
   |
   = note: BACKTRACE:
   = note: inside `std::sys::pal::windows::abort_internal` at /checkout/library/std/src/sys/pal/windows/mod.rs:359:5: 359:31
   = note: inside `std::panicking::rust_panic_with_hook` at /checkout/library/std/src/panicking.rs:855:9: 855:37
   = note: inside closure at /checkout/library/std/src/panicking.rs:699:13: 704:14
   = note: inside `std::sys::backtrace::__rust_end_short_backtrace::<{closure@std::panicking::begin_panic_handler::{closure#0}}, !>` at /checkout/library/std/src/sys/backtrace.rs:168:18: 168:21
   = note: inside `std::panicking::begin_panic_handler` at /checkout/library/std/src/panicking.rs:697:5: 713:7
   = note: inside `core::panicking::panic_nounwind` at /checkout/library/core/src/panicking.rs:218:5: 218:91
note: inside `main`
  --> tests/fail/intrinsics/zero_fn_ptr.rs:9:22
   |
LL |     let _ = unsafe { std::mem::zeroed::<fn()>() };
   |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^

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

error: aborting due to 1 previous error
---

thread 'main' panicked at /checkout/library/core/src/panicking.rs:218:5:
aborted execution: attempted to zero-initialize type `fn()`, which is invalid
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
thread caused non-unwinding panic. aborting.
error: abnormal termination: the program aborted execution
##[error]  --> /checkout/library/std/src/sys/pal/windows/mod.rs:359:5
   |
LL |     crate::intrinsics::abort()
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^ the program aborted execution
   |
   = note: BACKTRACE:
   = note: inside `std::sys::pal::windows::abort_internal` at /checkout/library/std/src/sys/pal/windows/mod.rs:359:5: 359:31
   = note: inside `std::panicking::rust_panic_with_hook` at /checkout/library/std/src/panicking.rs:855:9: 855:37
   = note: inside closure at /checkout/library/std/src/panicking.rs:699:13: 704:14
   = note: inside `std::sys::backtrace::__rust_end_short_backtrace::<{closure@std::panicking::begin_panic_handler::{closure#0}}, !>` at /checkout/library/std/src/sys/backtrace.rs:168:18: 168:21
   = note: inside `std::panicking::begin_panic_handler` at /checkout/library/std/src/panicking.rs:697:5: 713:7
   = note: inside `core::panicking::panic_nounwind` at /checkout/library/core/src/panicking.rs:218:5: 218:91
note: inside `main`
  --> tests/fail/intrinsics/zero_fn_ptr.rs:9:22
   |
LL |     let _ = unsafe { std::mem::zeroed::<fn()>() };
   |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^

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

error: aborting due to 1 previous error


full stdout:



FAILED TEST: tests/fail/intrinsics/uninit_uninhabited_type.rs
command: MIRI_ENV_VAR_TEST="0" MIRI_TEMP="/tmp/miri-uitest-tA8NtK" RUST_BACKTRACE="1" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/miri" "--error-format=json" "--sysroot=/checkout/obj/build/x86_64-unknown-linux-gnu/miri-sysroot" "-Dwarnings" "-Dunused" "-Ainternal_features" "-Zui-testing" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-tools/miri_ui/0/tests/fail/intrinsics" "tests/fail/intrinsics/uninit_uninhabited_type.rs" "--edition" "2021" "--target" "i686-pc-windows-msvc"

error: actual output differed from expected
Execute `./miri test --bless` to update `tests/fail/intrinsics/uninit_uninhabited_type.stderr` to the actual output
--- tests/fail/intrinsics/uninit_uninhabited_type.stderr
+++ <stderr output>
---

thread 'main' panicked at /checkout/library/core/src/panicking.rs:218:5:
aborted execution: attempted to instantiate uninhabited type `!`
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
thread caused non-unwinding panic. aborting.
error: abnormal termination: the program aborted execution
##[error]  --> /checkout/library/std/src/sys/pal/windows/mod.rs:359:5
   |
LL |     crate::intrinsics::abort()
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^ the program aborted execution
   |
   = note: BACKTRACE:
   = note: inside `std::sys::pal::windows::abort_internal` at /checkout/library/std/src/sys/pal/windows/mod.rs:359:5: 359:31
   = note: inside `std::panicking::rust_panic_with_hook` at /checkout/library/std/src/panicking.rs:855:9: 855:37
   = note: inside closure at /checkout/library/std/src/panicking.rs:699:13: 704:14
   = note: inside `std::sys::backtrace::__rust_end_short_backtrace::<{closure@std::panicking::begin_panic_handler::{closure#0}}, !>` at /checkout/library/std/src/sys/backtrace.rs:168:18: 168:21
   = note: inside `std::panicking::begin_panic_handler` at /checkout/library/std/src/panicking.rs:697:5: 713:7
   = note: inside `core::panicking::panic_nounwind` at /checkout/library/core/src/panicking.rs:218:5: 218:91
note: inside `main`
  --> tests/fail/intrinsics/uninit_uninhabited_type.rs:10:22
   |
LL |     let _ = unsafe { std::mem::uninitialized::<!>() };
   |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

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

error: aborting due to 1 previous error
---

thread 'main' panicked at /checkout/library/core/src/panicking.rs:218:5:
aborted execution: attempted to instantiate uninhabited type `!`
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
thread caused non-unwinding panic. aborting.
error: abnormal termination: the program aborted execution
##[error]  --> /checkout/library/std/src/sys/pal/windows/mod.rs:359:5
   |
LL |     crate::intrinsics::abort()
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^ the program aborted execution
   |
   = note: BACKTRACE:
   = note: inside `std::sys::pal::windows::abort_internal` at /checkout/library/std/src/sys/pal/windows/mod.rs:359:5: 359:31
   = note: inside `std::panicking::rust_panic_with_hook` at /checkout/library/std/src/panicking.rs:855:9: 855:37
   = note: inside closure at /checkout/library/std/src/panicking.rs:699:13: 704:14
   = note: inside `std::sys::backtrace::__rust_end_short_backtrace::<{closure@std::panicking::begin_panic_handler::{closure#0}}, !>` at /checkout/library/std/src/sys/backtrace.rs:168:18: 168:21
   = note: inside `std::panicking::begin_panic_handler` at /checkout/library/std/src/panicking.rs:697:5: 713:7
   = note: inside `core::panicking::panic_nounwind` at /checkout/library/core/src/panicking.rs:218:5: 218:91
note: inside `main`
  --> tests/fail/intrinsics/uninit_uninhabited_type.rs:10:22
   |
LL |     let _ = unsafe { std::mem::uninitialized::<!>() };
   |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

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

error: aborting due to 1 previous error


full stdout:



FAILED TEST: tests/fail/panic/panic_abort4.rs
command: MIRI_ENV_VAR_TEST="0" MIRI_TEMP="/tmp/miri-uitest-tA8NtK" RUST_BACKTRACE="1" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/miri" "--error-format=json" "--sysroot=/checkout/obj/build/x86_64-unknown-linux-gnu/miri-sysroot" "-Dwarnings" "-Dunused" "-Ainternal_features" "-Zui-testing" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-tools/miri_ui/0/tests/fail/panic" "tests/fail/panic/panic_abort4.rs" "-C" "panic=abort" "--edition" "2021" "--target" "i686-pc-windows-msvc"

error: actual output differed from expected
Execute `./miri test --bless` to update `tests/fail/panic/panic_abort4.stderr` to the actual output
--- tests/fail/panic/panic_abort4.stderr
+++ <stderr output>
---

thread 'main' panicked at tests/fail/panic/panic_abort4.rs:7:5:
42-panicking from libcore
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
error: abnormal termination: the program aborted execution
##[error]  --> /checkout/library/std/src/sys/pal/windows/mod.rs:359:5
   |
LL |     crate::intrinsics::abort()
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^ the program aborted execution
---
   = note: inside `panic_abort::__rust_start_panic` at /checkout/library/panic_abort/src/lib.rs:50:5: 50:19
   = note: inside `std::panicking::rust_panic` at /checkout/library/std/src/panicking.rs:894:25: 894:48
   = note: inside `std::panicking::rust_panic_with_hook` at /checkout/library/std/src/panicking.rs:858:5: 858:24
   = note: inside closure at /checkout/library/std/src/panicking.rs:699:13: 704:14
   = note: inside `std::sys::backtrace::__rust_end_short_backtrace::<{closure@std::panicking::begin_panic_handler::{closure#0}}, !>` at /checkout/library/std/src/sys/backtrace.rs:168:18: 168:21
   = note: inside `std::panicking::begin_panic_handler` at /checkout/library/std/src/panicking.rs:697:5: 713:7
note: inside `main`
  --> tests/fail/panic/panic_abort4.rs:7:5
   |
LL |     core::panic!("{}-panicking from libcore", 42);
---

thread 'main' panicked at tests/fail/panic/panic_abort4.rs:7:5:
42-panicking from libcore
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
error: abnormal termination: the program aborted execution
##[error]  --> /checkout/library/std/src/sys/pal/windows/mod.rs:359:5
   |
LL |     crate::intrinsics::abort()
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^ the program aborted execution
---
   = note: inside `panic_abort::__rust_start_panic` at /checkout/library/panic_abort/src/lib.rs:50:5: 50:19
   = note: inside `std::panicking::rust_panic` at /checkout/library/std/src/panicking.rs:894:25: 894:48
   = note: inside `std::panicking::rust_panic_with_hook` at /checkout/library/std/src/panicking.rs:858:5: 858:24
   = note: inside closure at /checkout/library/std/src/panicking.rs:699:13: 704:14
   = note: inside `std::sys::backtrace::__rust_end_short_backtrace::<{closure@std::panicking::begin_panic_handler::{closure#0}}, !>` at /checkout/library/std/src/sys/backtrace.rs:168:18: 168:21
   = note: inside `std::panicking::begin_panic_handler` at /checkout/library/std/src/panicking.rs:697:5: 713:7
note: inside `main`
  --> tests/fail/panic/panic_abort4.rs:7:5
   |
LL |     core::panic!("{}-panicking from libcore", 42);
---



FAILED TEST: tests/fail/panic/panic_abort3.rs
command: MIRI_ENV_VAR_TEST="0" MIRI_TEMP="/tmp/miri-uitest-tA8NtK" RUST_BACKTRACE="1" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/miri" "--error-format=json" "--sysroot=/checkout/obj/build/x86_64-unknown-linux-gnu/miri-sysroot" "-Dwarnings" "-Dunused" "-Ainternal_features" "-Zui-testing" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-tools/miri_ui/0/tests/fail/panic" "tests/fail/panic/panic_abort3.rs" "-C" "panic=abort" "--edition" "2021" "--target" "i686-pc-windows-msvc"

error: actual output differed from expected
Execute `./miri test --bless` to update `tests/fail/panic/panic_abort3.stderr` to the actual output
--- tests/fail/panic/panic_abort3.stderr
+++ <stderr output>
---

thread 'main' panicked at tests/fail/panic/panic_abort3.rs:7:5:
panicking from libcore
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
error: abnormal termination: the program aborted execution
##[error]  --> /checkout/library/std/src/sys/pal/windows/mod.rs:359:5
   |
LL |     crate::intrinsics::abort()
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^ the program aborted execution
---
   = note: inside `panic_abort::__rust_start_panic` at /checkout/library/panic_abort/src/lib.rs:50:5: 50:19
   = note: inside `std::panicking::rust_panic` at /checkout/library/std/src/panicking.rs:894:25: 894:48
   = note: inside `std::panicking::rust_panic_with_hook` at /checkout/library/std/src/panicking.rs:858:5: 858:24
   = note: inside closure at /checkout/library/std/src/panicking.rs:699:13: 704:14
   = note: inside `std::sys::backtrace::__rust_end_short_backtrace::<{closure@std::panicking::begin_panic_handler::{closure#0}}, !>` at /checkout/library/std/src/sys/backtrace.rs:168:18: 168:21
   = note: inside `std::panicking::begin_panic_handler` at /checkout/library/std/src/panicking.rs:697:5: 713:7
note: inside `main`
  --> tests/fail/panic/panic_abort3.rs:7:5
   |
LL |     core::panic!("panicking from libcore");
---

thread 'main' panicked at tests/fail/panic/panic_abort3.rs:7:5:
panicking from libcore
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
error: abnormal termination: the program aborted execution
##[error]  --> /checkout/library/std/src/sys/pal/windows/mod.rs:359:5
   |
LL |     crate::intrinsics::abort()
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^ the program aborted execution
---
   = note: inside `panic_abort::__rust_start_panic` at /checkout/library/panic_abort/src/lib.rs:50:5: 50:19
   = note: inside `std::panicking::rust_panic` at /checkout/library/std/src/panicking.rs:894:25: 894:48
   = note: inside `std::panicking::rust_panic_with_hook` at /checkout/library/std/src/panicking.rs:858:5: 858:24
   = note: inside closure at /checkout/library/std/src/panicking.rs:699:13: 704:14
   = note: inside `std::sys::backtrace::__rust_end_short_backtrace::<{closure@std::panicking::begin_panic_handler::{closure#0}}, !>` at /checkout/library/std/src/sys/backtrace.rs:168:18: 168:21
   = note: inside `std::panicking::begin_panic_handler` at /checkout/library/std/src/panicking.rs:697:5: 713:7
note: inside `main`
  --> tests/fail/panic/panic_abort3.rs:7:5
   |
LL |     core::panic!("panicking from libcore");
---



FAILED TEST: tests/fail/panic/panic_abort2.rs
command: MIRI_ENV_VAR_TEST="0" MIRI_TEMP="/tmp/miri-uitest-tA8NtK" RUST_BACKTRACE="1" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/miri" "--error-format=json" "--sysroot=/checkout/obj/build/x86_64-unknown-linux-gnu/miri-sysroot" "-Dwarnings" "-Dunused" "-Ainternal_features" "-Zui-testing" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-tools/miri_ui/0/tests/fail/panic" "tests/fail/panic/panic_abort2.rs" "-C" "panic=abort" "--edition" "2021" "--target" "i686-pc-windows-msvc"

error: actual output differed from expected
Execute `./miri test --bless` to update `tests/fail/panic/panic_abort2.stderr` to the actual output
--- tests/fail/panic/panic_abort2.stderr
+++ <stderr output>
---

thread 'main' panicked at tests/fail/panic/panic_abort2.rs:7:5:
42-panicking from libstd
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
error: abnormal termination: the program aborted execution
##[error]  --> /checkout/library/std/src/sys/pal/windows/mod.rs:359:5
   |
LL |     crate::intrinsics::abort()
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^ the program aborted execution
---
   = note: inside `panic_abort::__rust_start_panic` at /checkout/library/panic_abort/src/lib.rs:50:5: 50:19
   = note: inside `std::panicking::rust_panic` at /checkout/library/std/src/panicking.rs:894:25: 894:48
   = note: inside `std::panicking::rust_panic_with_hook` at /checkout/library/std/src/panicking.rs:858:5: 858:24
   = note: inside closure at /checkout/library/std/src/panicking.rs:699:13: 704:14
   = note: inside `std::sys::backtrace::__rust_end_short_backtrace::<{closure@std::panicking::begin_panic_handler::{closure#0}}, !>` at /checkout/library/std/src/sys/backtrace.rs:168:18: 168:21
   = note: inside `std::panicking::begin_panic_handler` at /checkout/library/std/src/panicking.rs:697:5: 713:7
note: inside `main`
  --> tests/fail/panic/panic_abort2.rs:7:5
   |
LL |     std::panic!("{}-panicking from libstd", 42);
---

thread 'main' panicked at tests/fail/panic/panic_abort2.rs:7:5:
42-panicking from libstd
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
error: abnormal termination: the program aborted execution
##[error]  --> /checkout/library/std/src/sys/pal/windows/mod.rs:359:5
   |
LL |     crate::intrinsics::abort()
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^ the program aborted execution
---
   = note: inside `panic_abort::__rust_start_panic` at /checkout/library/panic_abort/src/lib.rs:50:5: 50:19
   = note: inside `std::panicking::rust_panic` at /checkout/library/std/src/panicking.rs:894:25: 894:48
   = note: inside `std::panicking::rust_panic_with_hook` at /checkout/library/std/src/panicking.rs:858:5: 858:24
   = note: inside closure at /checkout/library/std/src/panicking.rs:699:13: 704:14
   = note: inside `std::sys::backtrace::__rust_end_short_backtrace::<{closure@std::panicking::begin_panic_handler::{closure#0}}, !>` at /checkout/library/std/src/sys/backtrace.rs:168:18: 168:21
   = note: inside `std::panicking::begin_panic_handler` at /checkout/library/std/src/panicking.rs:697:5: 713:7
note: inside `main`
  --> tests/fail/panic/panic_abort2.rs:7:5
   |
LL |     std::panic!("{}-panicking from libstd", 42);
---



FAILED TEST: tests/fail/panic/panic_abort1.rs
command: MIRI_ENV_VAR_TEST="0" MIRI_TEMP="/tmp/miri-uitest-tA8NtK" RUST_BACKTRACE="1" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/miri" "--error-format=json" "--sysroot=/checkout/obj/build/x86_64-unknown-linux-gnu/miri-sysroot" "-Dwarnings" "-Dunused" "-Ainternal_features" "-Zui-testing" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-tools/miri_ui/0/tests/fail/panic" "tests/fail/panic/panic_abort1.rs" "-C" "panic=abort" "--edition" "2021" "--target" "i686-pc-windows-msvc"

error: actual output differed from expected
Execute `./miri test --bless` to update `tests/fail/panic/panic_abort1.stderr` to the actual output
--- tests/fail/panic/panic_abort1.stderr
+++ <stderr output>
---

thread 'main' panicked at tests/fail/panic/panic_abort1.rs:7:5:
panicking from libstd
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
error: abnormal termination: the program aborted execution
##[error]  --> /checkout/library/std/src/sys/pal/windows/mod.rs:359:5
   |
LL |     crate::intrinsics::abort()
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^ the program aborted execution
---
   = note: inside `panic_abort::__rust_start_panic` at /checkout/library/panic_abort/src/lib.rs:50:5: 50:19
   = note: inside `std::panicking::rust_panic` at /checkout/library/std/src/panicking.rs:894:25: 894:48
   = note: inside `std::panicking::rust_panic_with_hook` at /checkout/library/std/src/panicking.rs:858:5: 858:24
   = note: inside closure at /checkout/library/std/src/panicking.rs:699:13: 704:14
   = note: inside `std::sys::backtrace::__rust_end_short_backtrace::<{closure@std::panicking::begin_panic_handler::{closure#0}}, !>` at /checkout/library/std/src/sys/backtrace.rs:168:18: 168:21
   = note: inside `std::panicking::begin_panic_handler` at /checkout/library/std/src/panicking.rs:697:5: 713:7
note: inside `main`
  --> tests/fail/panic/panic_abort1.rs:7:5
   |
LL |     std::panic!("panicking from libstd");
---

thread 'main' panicked at tests/fail/panic/panic_abort1.rs:7:5:
panicking from libstd
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
error: abnormal termination: the program aborted execution
##[error]  --> /checkout/library/std/src/sys/pal/windows/mod.rs:359:5
   |
LL |     crate::intrinsics::abort()
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^ the program aborted execution
---
   = note: inside `panic_abort::__rust_start_panic` at /checkout/library/panic_abort/src/lib.rs:50:5: 50:19
   = note: inside `std::panicking::rust_panic` at /checkout/library/std/src/panicking.rs:894:25: 894:48
   = note: inside `std::panicking::rust_panic_with_hook` at /checkout/library/std/src/panicking.rs:858:5: 858:24
   = note: inside closure at /checkout/library/std/src/panicking.rs:699:13: 704:14
   = note: inside `std::sys::backtrace::__rust_end_short_backtrace::<{closure@std::panicking::begin_panic_handler::{closure#0}}, !>` at /checkout/library/std/src/sys/backtrace.rs:168:18: 168:21
   = note: inside `std::panicking::begin_panic_handler` at /checkout/library/std/src/panicking.rs:697:5: 713:7
note: inside `main`
  --> tests/fail/panic/panic_abort1.rs:7:5
   |
LL |     std::panic!("panicking from libstd");
---



FAILED TEST: tests/fail/unwind-action-terminate.rs
command: MIRI_ENV_VAR_TEST="0" MIRI_TEMP="/tmp/miri-uitest-tA8NtK" RUST_BACKTRACE="1" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/miri" "--error-format=json" "--sysroot=/checkout/obj/build/x86_64-unknown-linux-gnu/miri-sysroot" "-Dwarnings" "-Dunused" "-Ainternal_features" "-Zui-testing" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-tools/miri_ui/0/tests/fail" "tests/fail/unwind-action-terminate.rs" "--edition" "2021" "--target" "i686-pc-windows-msvc"

error: actual output differed from expected
Execute `./miri test --bless` to update `tests/fail/unwind-action-terminate.stderr` to the actual output
--- tests/fail/unwind-action-terminate.stderr
+++ <stderr output>
---

thread 'main' panicked at tests/fail/unwind-action-terminate.rs:7:5:
explicit panic
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect

thread 'main' panicked at /checkout/library/core/src/panicking.rs:218:5:
panic in a function that cannot unwind
stack backtrace:
   0:   0xeb5464 - std::backtrace_rs::backtrace::miri::trace_unsynchronized::<&mut {closure@std::sys::backtrace::_print_fmt::{closure#1}}>
                       at /checkout/library/std/src/../../backtrace/src/backtrace/miri.rs:108:9
   1:   0xeb4fb7 - std::backtrace_rs::backtrace::miri::trace::<&mut {closure@std::sys::backtrace::_print_fmt::{closure#1}}>
                       at /checkout/library/std/src/../../backtrace/src/backtrace/miri.rs:65:14
   2:   0xeb3750 - std::backtrace_rs::backtrace::trace_unsynchronized::<{closure@std::sys::backtrace::_print_fmt::{closure#1}}>
                       at /checkout/library/std/src/../../backtrace/src/backtrace/mod.rs:66:14
   3:   0xd8e0d1 - std::sys::backtrace::_print_fmt
                       at /checkout/library/std/src/sys/backtrace.rs:66:9
   4:   0xd8dcb1 - <std::sys::backtrace::BacktraceLock<'_>::print::DisplayBacktrace as std::fmt::Display>::fmt
                       at /checkout/library/std/src/sys/backtrace.rs:39:26
---
  12:   0x1cb238 - std::panicking::rust_panic_with_hook
                       at /checkout/library/std/src/panicking.rs:833:13
  13:   0x1c9de9 - std::panicking::begin_panic_handler::{closure#0}
                       at /checkout/library/std/src/panicking.rs:699:13
  14:   0xd8ef58 - std::sys::backtrace::__rust_end_short_backtrace::<{closure@std::panicking::begin_panic_handler::{closure#0}}, !>
                       at /checkout/library/std/src/sys/backtrace.rs:168:18
  15:   0x1c9d7f - std::panicking::begin_panic_handler
                       at /checkout/library/std/src/panicking.rs:697:5
  16:   0x19022f - core::panicking::panic_nounwind_fmt::runtime
                       at /checkout/library/core/src/panicking.rs:117:22
  17:   0x3925fc - core::panicking::panic_nounwind_fmt
                       at /checkout/library/core/src/intrinsics/mod.rs:3241:9
---
  28:    0x91abd - std::panic::catch_unwind::<&dyn std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe, i32>
                       at /checkout/library/std/src/panic.rs:359:14
  29:   0x1a88ed - std::rt::lang_start_internal::{closure#0}
                       at /checkout/library/std/src/rt.rs:175:24
  30:   0x1c8fc3 - std::panicking::r#try::do_call::<{closure@std::rt::lang_start_internal::{closure#0}}, isize>
                       at /checkout/library/std/src/panicking.rs:589:40
  31:   0x1c8941 - std::panicking::r#try::<isize, {closure@std::rt::lang_start_internal::{closure#0}}>
                       at /checkout/library/std/src/panicking.rs:552:19
  32:    0x91ae4 - std::panic::catch_unwind::<{closure@std::rt::lang_start_internal::{closure#0}}, isize>
                       at /checkout/library/std/src/panic.rs:359:14
  33:   0x1a886d - std::rt::lang_start_internal
                       at /checkout/library/std/src/rt.rs:171:5
  34:   0x1a8d20 - std::rt::lang_start::<()>
                       at /checkout/library/std/src/rt.rs:205:5
---
   = note: BACKTRACE:
   = note: inside `std::sys::pal::windows::abort_internal` at /checkout/library/std/src/sys/pal/windows/mod.rs:359:5: 359:31
   = note: inside `std::panicking::rust_panic_with_hook` at /checkout/library/std/src/panicking.rs:855:9: 855:37
   = note: inside closure at /checkout/library/std/src/panicking.rs:699:13: 704:14
   = note: inside `std::sys::backtrace::__rust_end_short_backtrace::<{closure@std::panicking::begin_panic_handler::{closure#0}}, !>` at /checkout/library/std/src/sys/backtrace.rs:168:18: 168:21
   = note: inside `std::panicking::begin_panic_handler` at /checkout/library/std/src/panicking.rs:697:5: 713:7
   = note: inside `core::panicking::panic_nounwind` at /checkout/library/core/src/panicking.rs:218:5: 218:91
   = note: inside `core::panicking::panic_cannot_unwind` at /checkout/library/core/src/panicking.rs:323:5: 323:61
note: inside `panic_abort`
  --> tests/fail/unwind-action-terminate.rs:6:1
---

thread 'main' panicked at tests/fail/unwind-action-terminate.rs:7:5:
explicit panic
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect

thread 'main' panicked at /checkout/library/core/src/panicking.rs:218:5:
panic in a function that cannot unwind
stack backtrace:
   0:   0xeb5464 - std::backtrace_rs::backtrace::miri::trace_unsynchronized::<&mut {closure@std::sys::backtrace::_print_fmt::{closure#1}}>
                       at /checkout/library/std/src/../../backtrace/src/backtrace/miri.rs:108:9
   1:   0xeb4fb7 - std::backtrace_rs::backtrace::miri::trace::<&mut {closure@std::sys::backtrace::_print_fmt::{closure#1}}>
                       at /checkout/library/std/src/../../backtrace/src/backtrace/miri.rs:65:14
   2:   0xeb3750 - std::backtrace_rs::backtrace::trace_unsynchronized::<{closure@std::sys::backtrace::_print_fmt::{closure#1}}>
                       at /checkout/library/std/src/../../backtrace/src/backtrace/mod.rs:66:14
   3:   0xd8e0d1 - std::sys::backtrace::_print_fmt
                       at /checkout/library/std/src/sys/backtrace.rs:66:9
   4:   0xd8dcb1 - <std::sys::backtrace::BacktraceLock<'_>::print::DisplayBacktrace as std::fmt::Display>::fmt
                       at /checkout/library/std/src/sys/backtrace.rs:39:26
---
  12:   0x1cb238 - std::panicking::rust_panic_with_hook
                       at /checkout/library/std/src/panicking.rs:833:13
  13:   0x1c9de9 - std::panicking::begin_panic_handler::{closure#0}
                       at /checkout/library/std/src/panicking.rs:699:13
  14:   0xd8ef58 - std::sys::backtrace::__rust_end_short_backtrace::<{closure@std::panicking::begin_panic_handler::{closure#0}}, !>
                       at /checkout/library/std/src/sys/backtrace.rs:168:18
  15:   0x1c9d7f - std::panicking::begin_panic_handler
                       at /checkout/library/std/src/panicking.rs:697:5
  16:   0x19022f - core::panicking::panic_nounwind_fmt::runtime
                       at /checkout/library/core/src/panicking.rs:117:22
  17:   0x3925fc - core::panicking::panic_nounwind_fmt
                       at /checkout/library/core/src/intrinsics/mod.rs:3241:9
---
  28:    0x91abd - std::panic::catch_unwind::<&dyn std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe, i32>
                       at /checkout/library/std/src/panic.rs:359:14
  29:   0x1a88ed - std::rt::lang_start_internal::{closure#0}
                       at /checkout/library/std/src/rt.rs:175:24
  30:   0x1c8fc3 - std::panicking::r#try::do_call::<{closure@std::rt::lang_start_internal::{closure#0}}, isize>
                       at /checkout/library/std/src/panicking.rs:589:40
  31:   0x1c8941 - std::panicking::r#try::<isize, {closure@std::rt::lang_start_internal::{closure#0}}>
                       at /checkout/library/std/src/panicking.rs:552:19
  32:    0x91ae4 - std::panic::catch_unwind::<{closure@std::rt::lang_start_internal::{closure#0}}, isize>
                       at /checkout/library/std/src/panic.rs:359:14
  33:   0x1a886d - std::rt::lang_start_internal
                       at /checkout/library/std/src/rt.rs:171:5
  34:   0x1a8d20 - std::rt::lang_start::<()>
                       at /checkout/library/std/src/rt.rs:205:5
---
   = note: BACKTRACE:
   = note: inside `std::sys::pal::windows::abort_internal` at /checkout/library/std/src/sys/pal/windows/mod.rs:359:5: 359:31
   = note: inside `std::panicking::rust_panic_with_hook` at /checkout/library/std/src/panicking.rs:855:9: 855:37
   = note: inside closure at /checkout/library/std/src/panicking.rs:699:13: 704:14
   = note: inside `std::sys::backtrace::__rust_end_short_backtrace::<{closure@std::panicking::begin_panic_handler::{closure#0}}, !>` at /checkout/library/std/src/sys/backtrace.rs:168:18: 168:21
   = note: inside `std::panicking::begin_panic_handler` at /checkout/library/std/src/panicking.rs:697:5: 713:7
   = note: inside `core::panicking::panic_nounwind` at /checkout/library/core/src/panicking.rs:218:5: 218:91
   = note: inside `core::panicking::panic_cannot_unwind` at /checkout/library/core/src/panicking.rs:323:5: 323:61
note: inside `panic_abort`
  --> tests/fail/unwind-action-terminate.rs:6:1
---



FAILED TEST: tests/fail/terminate-terminator.rs
command: MIRI_ENV_VAR_TEST="0" MIRI_TEMP="/tmp/miri-uitest-tA8NtK" RUST_BACKTRACE="1" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/miri" "--error-format=json" "--sysroot=/checkout/obj/build/x86_64-unknown-linux-gnu/miri-sysroot" "-Dwarnings" "-Dunused" "-Ainternal_features" "-Zui-testing" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-tools/miri_ui/0/tests/fail" "tests/fail/terminate-terminator.rs" "-Zmir-opt-level=3" "-Zinline-mir-hint-threshold=1000" "--edition" "2021" "--target" "i686-pc-windows-msvc"

error: actual output differed from expected
Execute `./miri test --bless` to update `tests/fail/terminate-terminator.stderr` to the actual output
--- tests/fail/terminate-terminator.stderr
+++ <stderr output>
 warning: You have explicitly enabled MIR optimizations, overriding Miri's default which is to completely disable them. Any optimizations may hide UB that Miri would otherwise detect, and it is not necessarily possible to predict what kind of UB will be missed. If you are enabling optimizations to make Miri run faster, we advise using cfg(miri) to shrink your workload instead. The performance benefit of enabling MIR optimizations is usually marginal at best.
 
... 11 lines skipped ...
   --> RUSTLIB/std/src/sys/pal/PLATFORM/mod.rs:LL:CC
    |
-LL |     ABORT();
+LL |     crate::intrinsics::abort()
    | ^ the program aborted execution
    |
... 29 lines skipped ...
 error: aborting due to 1 previous error; 1 warning emitted
 

Full unnormalized output:
warning: You have explicitly enabled MIR optimizations, overriding Miri's default which is to completely disable them. Any optimizations may hide UB that Miri would otherwise detect, and it is not necessarily possible to predict what kind of UB will be missed. If you are enabling optimizations to make Miri run faster, we advise using cfg(miri) to shrink your workload instead. The performance benefit of enabling MIR optimizations is usually marginal at best.


thread 'main' panicked at tests/fail/terminate-terminator.rs:19:5:
explicit panic
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect

thread 'main' panicked at /checkout/library/core/src/panicking.rs:218:5:
panic in a function that cannot unwind
stack backtrace:
   0:   0xeb4c02 - std::backtrace_rs::backtrace::miri::trace_unsynchronized::<&mut {closure@std::sys::backtrace::_print_fmt::{closure#1}}>
                       at /checkout/library/std/src/../../backtrace/src/backtrace/miri.rs:108:9
   1:   0xeb4747 - std::backtrace_rs::backtrace::miri::trace::<&mut {closure@std::sys::backtrace::_print_fmt::{closure#1}}>
                       at /checkout/library/std/src/../../backtrace/src/backtrace/miri.rs:65:14
   2:   0xeb2ee6 - std::backtrace_rs::backtrace::trace_unsynchronized::<{closure@std::sys::backtrace::_print_fmt::{closure#1}}>
                       at /checkout/library/std/src/../../backtrace/src/backtrace/mod.rs:66:14
   3:   0xd8d867 - std::sys::backtrace::_print_fmt
                       at /checkout/library/std/src/sys/backtrace.rs:66:9
   4:   0xd8d44b - <std::sys::backtrace::BacktraceLock<'_>::print::DisplayBacktrace as std::fmt::Display>::fmt
                       at /checkout/library/std/src/sys/backtrace.rs:39:26
---
  12:   0x1ca9e5 - std::panicking::rust_panic_with_hook
                       at /checkout/library/std/src/panicking.rs:833:13
  13:   0x1c95a4 - std::panicking::begin_panic_handler::{closure#0}
                       at /checkout/library/std/src/panicking.rs:699:13
  14:   0xd8e71a - std::sys::backtrace::__rust_end_short_backtrace::<{closure@std::panicking::begin_panic_handler::{closure#0}}, !>
                       at /checkout/library/std/src/sys/backtrace.rs:168:18
  15:   0x1c9543 - std::panicking::begin_panic_handler
                       at /checkout/library/std/src/panicking.rs:697:5
  16:   0x18f9ec - core::panicking::panic_nounwind_fmt::runtime
                       at /checkout/library/core/src/panicking.rs:117:22
  17:   0x391db9 - core::panicking::panic_nounwind_fmt
                       at /checkout/library/core/src/intrinsics/mod.rs:3241:9
---
  28:    0x91264 - std::panic::catch_unwind::<&dyn std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe, i32>
                       at /checkout/library/std/src/panic.rs:359:14
  29:   0x1a8094 - std::rt::lang_start_internal::{closure#0}
                       at /checkout/library/std/src/rt.rs:175:24
  30:   0x1c8769 - std::panicking::r#try::do_call::<{closure@std::rt::lang_start_internal::{closure#0}}, isize>
                       at /checkout/library/std/src/panicking.rs:589:40
  31:   0x1c80f1 - std::panicking::r#try::<isize, {closure@std::rt::lang_start_internal::{closure#0}}>
                       at /checkout/library/std/src/panicking.rs:552:19
  32:    0x91288 - std::panic::catch_unwind::<{closure@std::rt::lang_start_internal::{closure#0}}, isize>
                       at /checkout/library/std/src/panic.rs:359:14
  33:   0x1a800f - std::rt::lang_start_internal
                       at /checkout/library/std/src/rt.rs:171:5
  34:   0x1a84c2 - std::rt::lang_start::<()>
                       at /checkout/library/std/src/rt.rs:205:5
---
   = note: BACKTRACE:
   = note: inside `std::sys::pal::windows::abort_internal` at /checkout/library/std/src/sys/pal/windows/mod.rs:359:5: 359:31
   = note: inside `std::panicking::rust_panic_with_hook` at /checkout/library/std/src/panicking.rs:855:9: 855:37
   = note: inside closure at /checkout/library/std/src/panicking.rs:699:13: 704:14
   = note: inside `std::sys::backtrace::__rust_end_short_backtrace::<{closure@std::panicking::begin_panic_handler::{closure#0}}, !>` at /checkout/library/std/src/sys/backtrace.rs:168:18: 168:21
   = note: inside `std::panicking::begin_panic_handler` at /checkout/library/std/src/panicking.rs:697:5: 713:7
   = note: inside `core::panicking::panic_nounwind` at /checkout/library/core/src/panicking.rs:218:5: 218:91
   = note: inside `core::panicking::panic_cannot_unwind` at /checkout/library/core/src/panicking.rs:323:5: 323:61
note: inside `has_cleanup`
  --> tests/fail/terminate-terminator.rs:17:1
---



full stderr:
warning: You have explicitly enabled MIR optimizations, overriding Miri's default which is to completely disable them. Any optimizations may hide UB that Miri would otherwise detect, and it is not necessarily possible to predict what kind of UB will be missed. If you are enabling optimizations to make Miri run faster, we advise using cfg(miri) to shrink your workload instead. The performance benefit of enabling MIR optimizations is usually marginal at best.


thread 'main' panicked at tests/fail/terminate-terminator.rs:19:5:
explicit panic
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect

thread 'main' panicked at /checkout/library/core/src/panicking.rs:218:5:
panic in a function that cannot unwind
stack backtrace:
   0:   0xeb4c02 - std::backtrace_rs::backtrace::miri::trace_unsynchronized::<&mut {closure@std::sys::backtrace::_print_fmt::{closure#1}}>
                       at /checkout/library/std/src/../../backtrace/src/backtrace/miri.rs:108:9
   1:   0xeb4747 - std::backtrace_rs::backtrace::miri::trace::<&mut {closure@std::sys::backtrace::_print_fmt::{closure#1}}>
                       at /checkout/library/std/src/../../backtrace/src/backtrace/miri.rs:65:14
   2:   0xeb2ee6 - std::backtrace_rs::backtrace::trace_unsynchronized::<{closure@std::sys::backtrace::_print_fmt::{closure#1}}>
                       at /checkout/library/std/src/../../backtrace/src/backtrace/mod.rs:66:14
   3:   0xd8d867 - std::sys::backtrace::_print_fmt
                       at /checkout/library/std/src/sys/backtrace.rs:66:9
   4:   0xd8d44b - <std::sys::backtrace::BacktraceLock<'_>::print::DisplayBacktrace as std::fmt::Display>::fmt
                       at /checkout/library/std/src/sys/backtrace.rs:39:26
---
  12:   0x1ca9e5 - std::panicking::rust_panic_with_hook
                       at /checkout/library/std/src/panicking.rs:833:13
  13:   0x1c95a4 - std::panicking::begin_panic_handler::{closure#0}
                       at /checkout/library/std/src/panicking.rs:699:13
  14:   0xd8e71a - std::sys::backtrace::__rust_end_short_backtrace::<{closure@std::panicking::begin_panic_handler::{closure#0}}, !>
                       at /checkout/library/std/src/sys/backtrace.rs:168:18
  15:   0x1c9543 - std::panicking::begin_panic_handler
                       at /checkout/library/std/src/panicking.rs:697:5
  16:   0x18f9ec - core::panicking::panic_nounwind_fmt::runtime
                       at /checkout/library/core/src/panicking.rs:117:22
  17:   0x391db9 - core::panicking::panic_nounwind_fmt
                       at /checkout/library/core/src/intrinsics/mod.rs:3241:9
---
  28:    0x91264 - std::panic::catch_unwind::<&dyn std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe, i32>
                       at /checkout/library/std/src/panic.rs:359:14
  29:   0x1a8094 - std::rt::lang_start_internal::{closure#0}
                       at /checkout/library/std/src/rt.rs:175:24
  30:   0x1c8769 - std::panicking::r#try::do_call::<{closure@std::rt::lang_start_internal::{closure#0}}, isize>
                       at /checkout/library/std/src/panicking.rs:589:40
  31:   0x1c80f1 - std::panicking::r#try::<isize, {closure@std::rt::lang_start_internal::{closure#0}}>
                       at /checkout/library/std/src/panicking.rs:552:19
  32:    0x91288 - std::panic::catch_unwind::<{closure@std::rt::lang_start_internal::{closure#0}}, isize>
                       at /checkout/library/std/src/panic.rs:359:14
  33:   0x1a800f - std::rt::lang_start_internal
                       at /checkout/library/std/src/rt.rs:171:5
  34:   0x1a84c2 - std::rt::lang_start::<()>
                       at /checkout/library/std/src/rt.rs:205:5
---
   = note: BACKTRACE:
   = note: inside `std::sys::pal::windows::abort_internal` at /checkout/library/std/src/sys/pal/windows/mod.rs:359:5: 359:31
   = note: inside `std::panicking::rust_panic_with_hook` at /checkout/library/std/src/panicking.rs:855:9: 855:37
   = note: inside closure at /checkout/library/std/src/panicking.rs:699:13: 704:14
   = note: inside `std::sys::backtrace::__rust_end_short_backtrace::<{closure@std::panicking::begin_panic_handler::{closure#0}}, !>` at /checkout/library/std/src/sys/backtrace.rs:168:18: 168:21
   = note: inside `std::panicking::begin_panic_handler` at /checkout/library/std/src/panicking.rs:697:5: 713:7
   = note: inside `core::panicking::panic_nounwind` at /checkout/library/core/src/panicking.rs:218:5: 218:91
   = note: inside `core::panicking::panic_cannot_unwind` at /checkout/library/core/src/panicking.rs:323:5: 323:61
note: inside `has_cleanup`
  --> tests/fail/terminate-terminator.rs:17:1
---



FAILED TEST: tests/fail/panic/double_panic.rs
command: MIRI_ENV_VAR_TEST="0" MIRI_TEMP="/tmp/miri-uitest-tA8NtK" RUST_BACKTRACE="1" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/miri" "--error-format=json" "--sysroot=/checkout/obj/build/x86_64-unknown-linux-gnu/miri-sysroot" "-Dwarnings" "-Dunused" "-Ainternal_features" "-Zui-testing" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-tools/miri_ui/0/tests/fail/panic" "tests/fail/panic/double_panic.rs" "--edition" "2021" "--target" "i686-pc-windows-msvc"

error: actual output differed from expected
Execute `./miri test --bless` to update `tests/fail/panic/double_panic.stderr` to the actual output
--- tests/fail/panic/double_panic.stderr
+++ <stderr output>
---

thread 'main' panicked at tests/fail/panic/double_panic.rs:15:5:
first
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect

thread 'main' panicked at tests/fail/panic/double_panic.rs:10:9:
second
stack backtrace:
   0:   0xeb29d1 - std::backtrace_rs::backtrace::miri::trace_unsynchronized::<&mut {closure@std::sys::backtrace::_print_fmt::{closure#1}}>
                       at /checkout/library/std/src/../../backtrace/src/backtrace/miri.rs:108:9
   1:   0xeb2516 - std::backtrace_rs::backtrace::miri::trace::<&mut {closure@std::sys::backtrace::_print_fmt::{closure#1}}>
                       at /checkout/library/std/src/../../backtrace/src/backtrace/miri.rs:65:14
   2:   0xeb0cb0 - std::backtrace_rs::backtrace::trace_unsynchronized::<{closure@std::sys::backtrace::_print_fmt::{closure#1}}>
                       at /checkout/library/std/src/../../backtrace/src/backtrace/mod.rs:66:14
   3:   0xd8b633 - std::sys::backtrace::_print_fmt
                       at /checkout/library/std/src/sys/backtrace.rs:66:9
   4:   0xd8b215 - <std::sys::backtrace::BacktraceLock<'_>::print::DisplayBacktrace as std::fmt::Display>::fmt
                       at /checkout/library/std/src/sys/backtrace.rs:39:26
---
  12:   0xcffa4b - std::panicking::rust_panic_with_hook
                       at /checkout/library/std/src/panicking.rs:833:13
  13:   0xcfe5fe - std::panicking::begin_panic_handler::{closure#0}
                       at /checkout/library/std/src/panicking.rs:699:13
  14:   0xd8c4de - std::sys::backtrace::__rust_end_short_backtrace::<{closure@std::panicking::begin_panic_handler::{closure#0}}, !>
                       at /checkout/library/std/src/sys/backtrace.rs:168:18
  15:   0xcfe5a1 - std::panicking::begin_panic_handler
                       at /checkout/library/std/src/panicking.rs:697:5
  16:   0x18d05c - std::rt::panic_fmt
                       at /checkout/library/core/src/panicking.rs:75:14
  17:    0x3e188 - <Foo as std::ops::Drop>::drop
                       at tests/fail/panic/double_panic.rs:10:9
---
  26:    0x8f02d - std::panic::catch_unwind::<&dyn std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe, i32>
                       at /checkout/library/std/src/panic.rs:359:14
  27:   0x1bf543 - std::rt::lang_start_internal::{closure#0}
                       at /checkout/library/std/src/rt.rs:175:24
  28:   0xcfd7cb - std::panicking::r#try::do_call::<{closure@std::rt::lang_start_internal::{closure#0}}, isize>
                       at /checkout/library/std/src/panicking.rs:589:40
  29:   0xcfd14a - std::panicking::r#try::<isize, {closure@std::rt::lang_start_internal::{closure#0}}>
                       at /checkout/library/std/src/panicking.rs:552:19
  30:    0x8f053 - std::panic::catch_unwind::<{closure@std::rt::lang_start_internal::{closure#0}}, isize>
                       at /checkout/library/std/src/panic.rs:359:14
  31:   0x1bf4b9 - std::rt::lang_start_internal
                       at /checkout/library/std/src/rt.rs:171:5
  32:   0x1bf979 - std::rt::lang_start::<()>
                       at /checkout/library/std/src/rt.rs:205:5
---
   = note: BACKTRACE:
   = note: inside `std::sys::pal::windows::abort_internal` at /checkout/library/std/src/sys/pal/windows/mod.rs:359:5: 359:31
   = note: inside `std::panicking::rust_panic_with_hook` at /checkout/library/std/src/panicking.rs:855:9: 855:37
   = note: inside closure at /checkout/library/std/src/panicking.rs:699:13: 704:14
   = note: inside `std::sys::backtrace::__rust_end_short_backtrace::<{closure@std::panicking::begin_panic_handler::{closure#0}}, !>` at /checkout/library/std/src/sys/backtrace.rs:168:18: 168:21
   = note: inside `std::panicking::begin_panic_handler` at /checkout/library/std/src/panicking.rs:697:5: 713:7
   = note: inside `core::panicking::panic_nounwind_nobacktrace` at /checkout/library/core/src/panicking.rs:226:5: 226:90
   = note: inside `core::panicking::panic_in_cleanup` at /checkout/library/core/src/panicking.rs:339:5: 339:71
note: inside `main`
  --> tests/fail/panic/double_panic.rs:13:1
---

thread 'main' panicked at tests/fail/panic/double_panic.rs:15:5:
first
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect

thread 'main' panicked at tests/fail/panic/double_panic.rs:10:9:
second
stack backtrace:
   0:   0xeb29d1 - std::backtrace_rs::backtrace::miri::trace_unsynchronized::<&mut {closure@std::sys::backtrace::_print_fmt::{closure#1}}>
                       at /checkout/library/std/src/../../backtrace/src/backtrace/miri.rs:108:9
   1:   0xeb2516 - std::backtrace_rs::backtrace::miri::trace::<&mut {closure@std::sys::backtrace::_print_fmt::{closure#1}}>
                       at /checkout/library/std/src/../../backtrace/src/backtrace/miri.rs:65:14
   2:   0xeb0cb0 - std::backtrace_rs::backtrace::trace_unsynchronized::<{closure@std::sys::backtrace::_print_fmt::{closure#1}}>
                       at /checkout/library/std/src/../../backtrace/src/backtrace/mod.rs:66:14
   3:   0xd8b633 - std::sys::backtrace::_print_fmt
                       at /checkout/library/std/src/sys/backtrace.rs:66:9
   4:   0xd8b215 - <std::sys::backtrace::BacktraceLock<'_>::print::DisplayBacktrace as std::fmt::Display>::fmt
                       at /checkout/library/std/src/sys/backtrace.rs:39:26
---
  12:   0xcffa4b - std::panicking::rust_panic_with_hook
                       at /checkout/library/std/src/panicking.rs:833:13
  13:   0xcfe5fe - std::panicking::begin_panic_handler::{closure#0}
                       at /checkout/library/std/src/panicking.rs:699:13
  14:   0xd8c4de - std::sys::backtrace::__rust_end_short_backtrace::<{closure@std::panicking::begin_panic_handler::{closure#0}}, !>
                       at /checkout/library/std/src/sys/backtrace.rs:168:18
  15:   0xcfe5a1 - std::panicking::begin_panic_handler
                       at /checkout/library/std/src/panicking.rs:697:5
  16:   0x18d05c - std::rt::panic_fmt
                       at /checkout/library/core/src/panicking.rs:75:14
  17:    0x3e188 - <Foo as std::ops::Drop>::drop
                       at tests/fail/panic/double_panic.rs:10:9
---
  26:    0x8f02d - std::panic::catch_unwind::<&dyn std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe, i32>
                       at /checkout/library/std/src/panic.rs:359:14
  27:   0x1bf543 - std::rt::lang_start_internal::{closure#0}
                       at /checkout/library/std/src/rt.rs:175:24
  28:   0xcfd7cb - std::panicking::r#try::do_call::<{closure@std::rt::lang_start_internal::{closure#0}}, isize>
                       at /checkout/library/std/src/panicking.rs:589:40
  29:   0xcfd14a - std::panicking::r#try::<isize, {closure@std::rt::lang_start_internal::{closure#0}}>
                       at /checkout/library/std/src/panicking.rs:552:19
  30:    0x8f053 - std::panic::catch_unwind::<{closure@std::rt::lang_start_internal::{closure#0}}, isize>
                       at /checkout/library/std/src/panic.rs:359:14
  31:   0x1bf4b9 - std::rt::lang_start_internal
                       at /checkout/library/std/src/rt.rs:171:5
  32:   0x1bf979 - std::rt::lang_start::<()>
                       at /checkout/library/std/src/rt.rs:205:5
---
   = note: BACKTRACE:
   = note: inside `std::sys::pal::windows::abort_internal` at /checkout/library/std/src/sys/pal/windows/mod.rs:359:5: 359:31
   = note: inside `std::panicking::rust_panic_with_hook` at /checkout/library/std/src/panicking.rs:855:9: 855:37
   = note: inside closure at /checkout/library/std/src/panicking.rs:699:13: 704:14
   = note: inside `std::sys::backtrace::__rust_end_short_backtrace::<{closure@std::panicking::begin_panic_handler::{closure#0}}, !>` at /checkout/library/std/src/sys/backtrace.rs:168:18: 168:21
   = note: inside `std::panicking::begin_panic_handler` at /checkout/library/std/src/panicking.rs:697:5: 713:7
   = note: inside `core::panicking::panic_nounwind_nobacktrace` at /checkout/library/core/src/panicking.rs:226:5: 226:90
   = note: inside `core::panicking::panic_in_cleanup` at /checkout/library/core/src/panicking.rs:339:5: 339:71
note: inside `main`
  --> tests/fail/panic/double_panic.rs:13:1
---



FAILED TEST: tests/fail/panic/abort_unwind.rs
command: MIRI_ENV_VAR_TEST="0" MIRI_TEMP="/tmp/miri-uitest-tA8NtK" RUST_BACKTRACE="1" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/miri" "--error-format=json" "--sysroot=/checkout/obj/build/x86_64-unknown-linux-gnu/miri-sysroot" "-Dwarnings" "-Dunused" "-Ainternal_features" "-Zui-testing" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-tools/miri_ui/0/tests/fail/panic" "tests/fail/panic/abort_unwind.rs" "--edition" "2021" "--target" "i686-pc-windows-msvc"

error: actual output differed from expected
Execute `./miri test --bless` to update `tests/fail/panic/abort_unwind.stderr` to the actual output
--- tests/fail/panic/abort_unwind.stderr
+++ <stderr output>
---

thread 'main' panicked at tests/fail/panic/abort_unwind.rs:10:33:
PANIC!!!
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect

thread 'main' panicked at /checkout/library/core/src/panicking.rs:218:5:
panic in a function that cannot unwind
stack backtrace:
   0:   0xeb3384 - std::backtrace_rs::backtrace::miri::trace_unsynchronized::<&mut {closure@std::sys::backtrace::_print_fmt::{closure#1}}>
                       at /checkout/library/std/src/../../backtrace/src/backtrace/miri.rs:108:9
   1:   0xeb2ed7 - std::backtrace_rs::backtrace::miri::trace::<&mut {closure@std::sys::backtrace::_print_fmt::{closure#1}}>
                       at /checkout/library/std/src/../../backtrace/src/backtrace/miri.rs:65:14
   2:   0xeb1670 - std::backtrace_rs::backtrace::trace_unsynchronized::<{closure@std::sys::backtrace::_print_fmt::{closure#1}}>
                       at /checkout/library/std/src/../../backtrace/src/backtrace/mod.rs:66:14
   3:   0xd8bff6 - std::sys::backtrace::_print_fmt
                       at /checkout/library/std/src/sys/backtrace.rs:66:9
   4:   0xd89c3d - <std::sys::backtrace::BacktraceLock<'_>::print::DisplayBacktrace as std::fmt::Display>::fmt
                       at /checkout/library/std/src/sys/backtrace.rs:39:26
---
  12:   0x1e216e - std::panicking::rust_panic_with_hook
                       at /checkout/library/std/src/panicking.rs:833:13
  13:   0x1e0d2c - std::panicking::begin_panic_handler::{closure#0}
                       at /checkout/library/std/src/panicking.rs:699:13
  14:   0xd8ceab - std::sys::backtrace::__rust_end_short_backtrace::<{closure@std::panicking::begin_panic_handler::{closure#0}}, !>
                       at /checkout/library/std/src/sys/backtrace.rs:168:18
  15:   0x1e0cc8 - std::panicking::begin_panic_handler
                       at /checkout/library/std/src/panicking.rs:697:5
  16:   0x18e187 - core::panicking::panic_nounwind_fmt::runtime
                       at /checkout/library/core/src/panicking.rs:117:22
  17:   0x3a954d - core::panicking::panic_nounwind_fmt
                       at /checkout/library/core/src/intrinsics/mod.rs:3241:9
  18:   0x18f830 - core::panicking::panic_nounwind
                       at /checkout/library/core/src/panicking.rs:218:5
  19:   0x1908e6 - core::panicking::panic_cannot_unwind
                       at /checkout/library/core/src/panicking.rs:323:5
  20:    0xc6e4f - std::panic::abort_unwind::<{closure@tests/fail/panic/abort_unwind.rs:10:30: 10:32}, ()>
                       at /checkout/library/core/src/panic.rs:164:1
  21:    0x3eb91 - main
                       at tests/fail/panic/abort_unwind.rs:10:5
  22:   0x121d2a - <fn() as std::ops::FnOnce<()>>::call_once - shim(fn())
                       at /checkout/library/core/src/ops/function.rs:250:5
---
  28:    0x8fa01 - std::panic::catch_unwind::<&dyn std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe, i32>
                       at /checkout/library/std/src/panic.rs:359:14
  29:   0x1c12b0 - std::rt::lang_start_internal::{closure#0}
                       at /checkout/library/std/src/rt.rs:175:24
  30:   0x1dff00 - std::panicking::r#try::do_call::<{closure@std::rt::lang_start_internal::{closure#0}}, isize>
                       at /checkout/library/std/src/panicking.rs:589:40
  31:   0x1df87a - std::panicking::r#try::<isize, {closure@std::rt::lang_start_internal::{closure#0}}>
                       at /checkout/library/std/src/panicking.rs:552:19
  32:    0x8fa29 - std::panic::catch_unwind::<{closure@std::rt::lang_start_internal::{closure#0}}, isize>
                       at /checkout/library/std/src/panic.rs:359:14
  33:   0x1c122a - std::rt::lang_start_internal
                       at /checkout/library/std/src/rt.rs:171:5
  34:   0x1c16de - std::rt::lang_start::<()>
                       at /checkout/library/std/src/rt.rs:205:5
---
   = note: BACKTRACE:
   = note: inside `std::sys::pal::windows::abort_internal` at /checkout/library/std/src/sys/pal/windows/mod.rs:359:5: 359:31
   = note: inside `std::panicking::rust_panic_with_hook` at /checkout/library/std/src/panicking.rs:855:9: 855:37
   = note: inside closure at /checkout/library/std/src/panicking.rs:699:13: 704:14
   = note: inside `std::sys::backtrace::__rust_end_short_backtrace::<{closure@std::panicking::begin_panic_handler::{closure#0}}, !>` at /checkout/library/std/src/sys/backtrace.rs:168:18: 168:21
   = note: inside `std::panicking::begin_panic_handler` at /checkout/library/std/src/panicking.rs:697:5: 713:7
   = note: inside `core::panicking::panic_nounwind` at /checkout/library/core/src/panicking.rs:218:5: 218:91
   = note: inside `core::panicking::panic_cannot_unwind` at /checkout/library/core/src/panicking.rs:323:5: 323:61
   = note: inside `std::panic::abort_unwind::<{closure@tests/fail/panic/abort_unwind.rs:10:30: 10:32}, ()>` at /checkout/library/core/src/panic.rs:164:1: 166:2
note: inside `main`
  --> tests/fail/panic/abort_unwind.rs:10:5
   |
LL |     std::panic::abort_unwind(|| panic!("PANIC!!!"));
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

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

error: aborting due to 1 previous error
---

thread 'main' panicked at tests/fail/panic/abort_unwind.rs:10:33:
PANIC!!!
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect

thread 'main' panicked at /checkout/library/core/src/panicking.rs:218:5:
panic in a function that cannot unwind
stack backtrace:
   0:   0xeb3384 - std::backtrace_rs::backtrace::miri::trace_unsynchronized::<&mut {closure@std::sys::backtrace::_print_fmt::{closure#1}}>
                       at /checkout/library/std/src/../../backtrace/src/backtrace/miri.rs:108:9
   1:   0xeb2ed7 - std::backtrace_rs::backtrace::miri::trace::<&mut {closure@std::sys::backtrace::_print_fmt::{closure#1}}>
                       at /checkout/library/std/src/../../backtrace/src/backtrace/miri.rs:65:14
   2:   0xeb1670 - std::backtrace_rs::backtrace::trace_unsynchronized::<{closure@std::sys::backtrace::_print_fmt::{closure#1}}>
                       at /checkout/library/std/src/../../backtrace/src/backtrace/mod.rs:66:14
   3:   0xd8bff6 - std::sys::backtrace::_print_fmt
                       at /checkout/library/std/src/sys/backtrace.rs:66:9
   4:   0xd89c3d - <std::sys::backtrace::BacktraceLock<'_>::print::DisplayBacktrace as std::fmt::Display>::fmt
                       at /checkout/library/std/src/sys/backtrace.rs:39:26
---
  12:   0x1e216e - std::panicking::rust_panic_with_hook
                       at /checkout/library/std/src/panicking.rs:833:13
  13:   0x1e0d2c - std::panicking::begin_panic_handler::{closure#0}
                       at /checkout/library/std/src/panicking.rs:699:13
  14:   0xd8ceab - std::sys::backtrace::__rust_end_short_backtrace::<{closure@std::panicking::begin_panic_handler::{closure#0}}, !>
                       at /checkout/library/std/src/sys/backtrace.rs:168:18
  15:   0x1e0cc8 - std::panicking::begin_panic_handler
                       at /checkout/library/std/src/panicking.rs:697:5
  16:   0x18e187 - core::panicking::panic_nounwind_fmt::runtime
                       at /checkout/library/core/src/panicking.rs:117:22
  17:   0x3a954d - core::panicking::panic_nounwind_fmt
                       at /checkout/library/core/src/intrinsics/mod.rs:3241:9
  18:   0x18f830 - core::panicking::panic_nounwind
                       at /checkout/library/core/src/panicking.rs:218:5
  19:   0x1908e6 - core::panicking::panic_cannot_unwind
                       at /checkout/library/core/src/panicking.rs:323:5
  20:    0xc6e4f - std::panic::abort_unwind::<{closure@tests/fail/panic/abort_unwind.rs:10:30: 10:32}, ()>
                       at /checkout/library/core/src/panic.rs:164:1
  21:    0x3eb91 - main
                       at tests/fail/panic/abort_unwind.rs:10:5
  22:   0x121d2a - <fn() as std::ops::FnOnce<()>>::call_once - shim(fn())
                       at /checkout/library/core/src/ops/function.rs:250:5
---
  28:    0x8fa01 - std::panic::catch_unwind::<&dyn std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe, i32>
                       at /checkout/library/std/src/panic.rs:359:14
  29:   0x1c12b0 - std::rt::lang_start_internal::{closure#0}
                       at /checkout/library/std/src/rt.rs:175:24
  30:   0x1dff00 - std::panicking::r#try::do_call::<{closure@std::rt::lang_start_internal::{closure#0}}, isize>
                       at /checkout/library/std/src/panicking.rs:589:40
  31:   0x1df87a - std::panicking::r#try::<isize, {closure@std::rt::lang_start_internal::{closure#0}}>
                       at /checkout/library/std/src/panicking.rs:552:19
  32:    0x8fa29 - std::panic::catch_unwind::<{closure@std::rt::lang_start_internal::{closure#0}}, isize>
                       at /checkout/library/std/src/panic.rs:359:14
  33:   0x1c122a - std::rt::lang_start_internal
                       at /checkout/library/std/src/rt.rs:171:5
  34:   0x1c16de - std::rt::lang_start::<()>
                       at /checkout/library/std/src/rt.rs:205:5
---
   = note: BACKTRACE:
   = note: inside `std::sys::pal::windows::abort_internal` at /checkout/library/std/src/sys/pal/windows/mod.rs:359:5: 359:31
   = note: inside `std::panicking::rust_panic_with_hook` at /checkout/library/std/src/panicking.rs:855:9: 855:37
   = note: inside closure at /checkout/library/std/src/panicking.rs:699:13: 704:14
   = note: inside `std::sys::backtrace::__rust_end_short_backtrace::<{closure@std::panicking::begin_panic_handler::{closure#0}}, !>` at /checkout/library/std/src/sys/backtrace.rs:168:18: 168:21
   = note: inside `std::panicking::begin_panic_handler` at /checkout/library/std/src/panicking.rs:697:5: 713:7
   = note: inside `core::panicking::panic_nounwind` at /checkout/library/core/src/panicking.rs:218:5: 218:91
   = note: inside `core::panicking::panic_cannot_unwind` at /checkout/library/core/src/panicking.rs:323:5: 323:61
   = note: inside `std::panic::abort_unwind::<{closure@tests/fail/panic/abort_unwind.rs:10:30: 10:32}, ()>` at /checkout/library/core/src/panic.rs:164:1: 166:2
note: inside `main`
  --> tests/fail/panic/abort_unwind.rs:10:5
   |
LL |     std::panic::abort_unwind(|| panic!("PANIC!!!"));
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

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

error: aborting due to 1 previous error


full stdout:



FAILED TEST: tests/fail/function_calls/exported_symbol_bad_unwind2.rs (revision `definition`)
command: MIRI_ENV_VAR_TEST="0" MIRI_TEMP="/tmp/miri-uitest-tA8NtK" RUST_BACKTRACE="1" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/miri" "--error-format=json" "--sysroot=/checkout/obj/build/x86_64-unknown-linux-gnu/miri-sysroot" "-Dwarnings" "-Dunused" "-Ainternal_features" "-Zui-testing" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-tools/miri_ui/0/tests/fail/function_calls" "tests/fail/function_calls/exported_symbol_bad_unwind2.rs" "--edition" "2021" "--cfg=definition" "-Cextra-filename=definition" "--target" "i686-pc-windows-msvc"

error: actual output differed from expected
Execute `./miri test --bless` to update `tests/fail/function_calls/exported_symbol_bad_unwind2.definition.stderr` to the actual output
--- tests/fail/function_calls/exported_symbol_bad_unwind2.definition.stderr
+++ <stderr output>
---

thread 'main' panicked at tests/fail/function_calls/exported_symbol_bad_unwind2.rs:12:5:
explicit panic
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect

thread 'main' panicked at /checkout/library/core/src/panicking.rs:218:5:
panic in a function that cannot unwind
stack backtrace:
   0:   0xeb5080 - std::backtrace_rs::backtrace::miri::trace_unsynchronized::<&mut {closure@std::sys::backtrace::_print_fmt::{closure#1}}>
                       at /checkout/library/std/src/../../backtrace/src/backtrace/miri.rs:108:9
   1:   0xeb4bc8 - std::backtrace_rs::backtrace::miri::trace::<&mut {closure@std::sys::backtrace::_print_fmt::{closure#1}}>
                       at /checkout/library/std/src/../../backtrace/src/backtrace/miri.rs:65:14
   2:   0xeb336e - std::backtrace_rs::backtrace::trace_unsynchronized::<{closure@std::sys::backtrace::_print_fmt::{closure#1}}>
                       at /checkout/library/std/src/../../backtrace/src/backtrace/mod.rs:66:14
   3:   0xd8dcf1 - std::sys::backtrace::_print_fmt
                       at /checkout/library/std/src/sys/backtrace.rs:66:9
   4:   0xd8d8d6 - <std::sys::backtrace::BacktraceLock<'_>::print::DisplayBacktrace as std::fmt::Display>::fmt
                       at /checkout/library/std/src/sys/backtrace.rs:39:26
---
  12:   0x1cae8d - std::panicking::rust_panic_with_hook
                       at /checkout/library/std/src/panicking.rs:833:13
  13:   0x1c9a48 - std::panicking::begin_panic_handler::{closure#0}
                       at /checkout/library/std/src/panicking.rs:699:13
  14:   0xd8ebc0 - std::sys::backtrace::__rust_end_short_backtrace::<{closure@std::panicking::begin_panic_handler::{closure#0}}, !>
                       at /checkout/library/std/src/sys/backtrace.rs:168:18
  15:   0x1c99e8 - std::panicking::begin_panic_handler
                       at /checkout/library/std/src/panicking.rs:697:5
  16:   0x18fe8d - core::panicking::panic_nounwind_fmt::runtime
                       at /checkout/library/core/src/panicking.rs:117:22
  17:   0x392257 - core::panicking::panic_nounwind_fmt
                       at /checkout/library/core/src/intrinsics/mod.rs:3241:9
---
  28:    0x9170e - std::panic::catch_unwind::<&dyn std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe, i32>
                       at /checkout/library/std/src/panic.rs:359:14
  29:   0x1a853c - std::rt::lang_start_internal::{closure#0}
                       at /checkout/library/std/src/rt.rs:175:24
  30:   0x1c8c14 - std::panicking::r#try::do_call::<{closure@std::rt::lang_start_internal::{closure#0}}, isize>
                       at /checkout/library/std/src/panicking.rs:589:40
  31:   0x1c859c - std::panicking::r#try::<isize, {closure@std::rt::lang_start_internal::{closure#0}}>
                       at /checkout/library/std/src/panicking.rs:552:19
  32:    0x91740 - std::panic::catch_unwind::<{closure@std::rt::lang_start_internal::{closure#0}}, isize>
                       at /checkout/library/std/src/panic.rs:359:14
  33:   0x1a84c8 - std::rt::lang_start_internal
                       at /checkout/library/std/src/rt.rs:171:5
  34:   0x1a8984 - std::rt::lang_start::<()>
                       at /checkout/library/std/src/rt.rs:205:5
---
   = note: BACKTRACE:
   = note: inside `std::sys::pal::windows::abort_internal` at /checkout/library/std/src/sys/pal/windows/mod.rs:359:5: 359:31
   = note: inside `std::panicking::rust_panic_with_hook` at /checkout/library/std/src/panicking.rs:855:9: 855:37
   = note: inside closure at /checkout/library/std/src/panicking.rs:699:13: 704:14
   = note: inside `std::sys::backtrace::__rust_end_short_backtrace::<{closure@std::panicking::begin_panic_handler::{closure#0}}, !>` at /checkout/library/std/src/sys/backtrace.rs:168:18: 168:21
   = note: inside `std::panicking::begin_panic_handler` at /checkout/library/std/src/panicking.rs:697:5: 713:7
   = note: inside `core::panicking::panic_nounwind` at /checkout/library/core/src/panicking.rs:218:5: 218:91
   = note: inside `core::panicking::panic_cannot_unwind` at /checkout/library/core/src/panicking.rs:323:5: 323:61
note: inside `nounwind`
  --> tests/fail/function_calls/exported_symbol_bad_unwind2.rs:11:1
   |
LL | / extern "C-unwind" fn nounwind() {
LL | |     panic!();
LL | | }
   | |_^
note: inside `main`
  --> tests/fail/function_calls/exported_symbol_bad_unwind2.rs:20:14
---

thread 'main' panicked at tests/fail/function_calls/exported_symbol_bad_unwind2.rs:12:5:
explicit panic
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect

thread 'main' panicked at /checkout/library/core/src/panicking.rs:218:5:
panic in a function that cannot unwind
stack backtrace:
   0:   0xeb5080 - std::backtrace_rs::backtrace::miri::trace_unsynchronized::<&mut {closure@std::sys::backtrace::_print_fmt::{closure#1}}>
                       at /checkout/library/std/src/../../backtrace/src/backtrace/miri.rs:108:9
   1:   0xeb4bc8 - std::backtrace_rs::backtrace::miri::trace::<&mut {closure@std::sys::backtrace::_print_fmt::{closure#1}}>
                       at /checkout/library/std/src/../../backtrace/src/backtrace/miri.rs:65:14
   2:   0xeb336e - std::backtrace_rs::backtrace::trace_unsynchronized::<{closure@std::sys::backtrace::_print_fmt::{closure#1}}>
                       at /checkout/library/std/src/../../backtrace/src/backtrace/mod.rs:66:14
   3:   0xd8dcf1 - std::sys::backtrace::_print_fmt
                       at /checkout/library/std/src/sys/backtrace.rs:66:9
   4:   0xd8d8d6 - <std::sys::backtrace::BacktraceLock<'_>::print::DisplayBacktrace as std::fmt::Display>::fmt
                       at /checkout/library/std/src/sys/backtrace.rs:39:26
---
  12:   0x1cae8d - std::panicking::rust_panic_with_hook
                       at /checkout/library/std/src/panicking.rs:833:13
  13:   0x1c9a48 - std::panicking::begin_panic_handler::{closure#0}
                       at /checkout/library/std/src/panicking.rs:699:13
  14:   0xd8ebc0 - std::sys::backtrace::__rust_end_short_backtrace::<{closure@std::panicking::begin_panic_handler::{closure#0}}, !>
                       at /checkout/library/std/src/sys/backtrace.rs:168:18
  15:   0x1c99e8 - std::panicking::begin_panic_handler
                       at /checkout/library/std/src/panicking.rs:697:5
  16:   0x18fe8d - core::panicking::panic_nounwind_fmt::runtime
                       at /checkout/library/core/src/panicking.rs:117:22
  17:   0x392257 - core::panicking::panic_nounwind_fmt
                       at /checkout/library/core/src/intrinsics/mod.rs:3241:9
---
  28:    0x9170e - std::panic::catch_unwind::<&dyn std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe, i32>
                       at /checkout/library/std/src/panic.rs:359:14
  29:   0x1a853c - std::rt::lang_start_internal::{closure#0}
                       at /checkout/library/std/src/rt.rs:175:24
  30:   0x1c8c14 - std::panicking::r#try::do_call::<{closure@std::rt::lang_start_internal::{closure#0}}, isize>
                       at /checkout/library/std/src/panicking.rs:589:40
  31:   0x1c859c - std::panicking::r#try::<isize, {closure@std::rt::lang_start_internal::{closure#0}}>
                       at /checkout/library/std/src/panicking.rs:552:19
  32:    0x91740 - std::panic::catch_unwind::<{closure@std::rt::lang_start_internal::{closure#0}}, isize>
                       at /checkout/library/std/src/panic.rs:359:14
  33:   0x1a84c8 - std::rt::lang_start_internal
                       at /checkout/library/std/src/rt.rs:171:5
  34:   0x1a8984 - std::rt::lang_start::<()>
                       at /checkout/library/std/src/rt.rs:205:5
---
   = note: BACKTRACE:
   = note: inside `std::sys::pal::windows::abort_internal` at /checkout/library/std/src/sys/pal/windows/mod.rs:359:5: 359:31
   = note: inside `std::panicking::rust_panic_with_hook` at /checkout/library/std/src/panicking.rs:855:9: 855:37
   = note: inside closure at /checkout/library/std/src/panicking.rs:699:13: 704:14
   = note: inside `std::sys::backtrace::__rust_end_short_backtrace::<{closure@std::panicking::begin_panic_handler::{closure#0}}, !>` at /checkout/library/std/src/sys/backtrace.rs:168:18: 168:21
   = note: inside `std::panicking::begin_panic_handler` at /checkout/library/std/src/panicking.rs:697:5: 713:7
   = note: inside `core::panicking::panic_nounwind` at /checkout/library/core/src/panicking.rs:218:5: 218:91
   = note: inside `core::panicking::panic_cannot_unwind` at /checkout/library/core/src/panicking.rs:323:5: 323:61
note: inside `nounwind`
  --> tests/fail/function_calls/exported_symbol_bad_unwind2.rs:11:1
   |
LL | / extern "C-unwind" fn nounwind() {
LL | |     panic!();
LL | | }
   | |_^
note: inside `main`
  --> tests/fail/function_calls/exported_symbol_bad_unwind2.rs:20:14
---



FAILED TEST: tests/fail/function_calls/exported_symbol_bad_unwind2.rs (revision `both`)
command: MIRI_ENV_VAR_TEST="0" MIRI_TEMP="/tmp/miri-uitest-tA8NtK" RUST_BACKTRACE="1" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/miri" "--error-format=json" "--sysroot=/checkout/obj/build/x86_64-unknown-linux-gnu/miri-sysroot" "-Dwarnings" "-Dunused" "-Ainternal_features" "-Zui-testing" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-tools/miri_ui/0/tests/fail/function_calls" "tests/fail/function_calls/exported_symbol_bad_unwind2.rs" "--edition" "2021" "--cfg=both" "-Cextra-filename=both" "--target" "i686-pc-windows-msvc"

error: actual output differed from expected
Execute `./miri test --bless` to update `tests/fail/function_calls/exported_symbol_bad_unwind2.both.stderr` to the actual output
--- tests/fail/function_calls/exported_symbol_bad_unwind2.both.stderr
+++ <stderr output>
 
 thread 'main' panicked at tests/fail/function_calls/exported_symbol_bad_unwind2.rs:LL:CC:
... 9 lines skipped ...
   --> RUSTLIB/std/src/sys/pal/PLATFORM/mod.rs:LL:CC
---

thread 'main' panicked at tests/fail/function_calls/exported_symbol_bad_unwind2.rs:12:5:
explicit panic
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect

thread 'main' panicked at /checkout/library/core/src/panicking.rs:218:5:
panic in a function that cannot unwind
stack backtrace:
   0:   0xeb5080 - std::backtrace_rs::backtrace::miri::trace_unsynchronized::<&mut {closure@std::sys::backtrace::_print_fmt::{closure#1}}>
                       at /checkout/library/std/src/../../backtrace/src/backtrace/miri.rs:108:9
   1:   0xeb4bc8 - std::backtrace_rs::backtrace::miri::trace::<&mut {closure@std::sys::backtrace::_print_fmt::{closure#1}}>
                       at /checkout/library/std/src/../../backtrace/src/backtrace/miri.rs:65:14
   2:   0xeb336e - std::backtrace_rs::backtrace::trace_unsynchronized::<{closure@std::sys::backtrace::_print_fmt::{closure#1}}>
                       at /checkout/library/std/src/../../backtrace/src/backtrace/mod.rs:66:14
   3:   0xd8dcf1 - std::sys::backtrace::_print_fmt
                       at /checkout/library/std/src/sys/backtrace.rs:66:9
   4:   0xd8d8d6 - <std::sys::backtrace::BacktraceLock<'_>::print::DisplayBacktrace as std::fmt::Display>::fmt
                       at /checkout/library/std/src/sys/backtrace.rs:39:26
---
  12:   0x1cae8d - std::panicking::rust_panic_with_hook
                       at /checkout/library/std/src/panicking.rs:833:13
  13:   0x1c9a48 - std::panicking::begin_panic_handler::{closure#0}
                       at /checkout/library/std/src/panicking.rs:699:13
  14:   0xd8ebc0 - std::sys::backtrace::__rust_end_short_backtrace::<{closure@std::panicking::begin_panic_handler::{closure#0}}, !>
                       at /checkout/library/std/src/sys/backtrace.rs:168:18
  15:   0x1c99e8 - std::panicking::begin_panic_handler
                       at /checkout/library/std/src/panicking.rs:697:5
  16:   0x18fe8d - core::panicking::panic_nounwind_fmt::runtime
                       at /checkout/library/core/src/panicking.rs:117:22
  17:   0x392257 - core::panicking::panic_nounwind_fmt
                       at /checkout/library/core/src/intrinsics/mod.rs:3241:9
---
  28:    0x9170e - std::panic::catch_unwind::<&dyn std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe, i32>
                       at /checkout/library/std/src/panic.rs:359:14
  29:   0x1a853c - std::rt::lang_start_internal::{closure#0}
                       at /checkout/library/std/src/rt.rs:175:24
  30:   0x1c8c14 - std::panicking::r#try::do_call::<{closure@std::rt::lang_start_internal::{closure#0}}, isize>
                       at /checkout/library/std/src/panicking.rs:589:40
  31:   0x1c859c - std::panicking::r#try::<isize, {closure@std::rt::lang_start_internal::{closure#0}}>
                       at /checkout/library/std/src/panicking.rs:552:19
  32:    0x91740 - std::panic::catch_unwind::<{closure@std::rt::lang_start_internal::{closure#0}}, isize>
                       at /checkout/library/std/src/panic.rs:359:14
  33:   0x1a84c8 - std::rt::lang_start_internal
                       at /checkout/library/std/src/rt.rs:171:5
  34:   0x1a8984 - std::rt::lang_start::<()>
                       at /checkout/library/std/src/rt.rs:205:5
---
   = note: BACKTRACE:
   = note: inside `std::sys::pal::windows::abort_internal` at /checkout/library/std/src/sys/pal/windows/mod.rs:359:5: 359:31
   = note: inside `std::panicking::rust_panic_with_hook` at /checkout/library/std/src/panicking.rs:855:9: 855:37
   = note: inside closure at /checkout/library/std/src/panicking.rs:699:13: 704:14
   = note: inside `std::sys::backtrace::__rust_end_short_backtrace::<{closure@std::panicking::begin_panic_handler::{closure#0}}, !>` at /checkout/library/std/src/sys/backtrace.rs:168:18: 168:21
   = note: inside `std::panicking::begin_panic_handler` at /checkout/library/std/src/panicking.rs:697:5: 713:7
   = note: inside `core::panicking::panic_nounwind` at /checkout/library/core/src/panicking.rs:218:5: 218:91
   = note: inside `core::panicking::panic_cannot_unwind` at /checkout/library/core/src/panicking.rs:323:5: 323:61
note: inside `nounwind`
  --> tests/fail/function_calls/exported_symbol_bad_unwind2.rs:11:1
   |
LL | / extern "C-unwind" fn nounwind() {
LL | |     panic!();
LL | | }
   | |_^
note: inside `main`
  --> tests/fail/function_calls/exported_symbol_bad_unwind2.rs:20:14
---

thread 'main' panicked at tests/fail/function_calls/exported_symbol_bad_unwind2.rs:12:5:
explicit panic
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect

thread 'main' panicked at /checkout/library/core/src/panicking.rs:218:5:
panic in a function that cannot unwind
stack backtrace:
   0:   0xeb5080 - std::backtrace_rs::backtrace::miri::trace_unsynchronized::<&mut {closure@std::sys::backtrace::_print_fmt::{closure#1}}>
                       at /checkout/library/std/src/../../backtrace/src/backtrace/miri.rs:108:9
   1:   0xeb4bc8 - std::backtrace_rs::backtrace::miri::trace::<&mut {closure@std::sys::backtrace::_print_fmt::{closure#1}}>
                       at /checkout/library/std/src/../../backtrace/src/backtrace/miri.rs:65:14
   2:   0xeb336e - std::backtrace_rs::backtrace::trace_unsynchronized::<{closure@std::sys::backtrace::_print_fmt::{closure#1}}>
                       at /checkout/library/std/src/../../backtrace/src/backtrace/mod.rs:66:14
   3:   0xd8dcf1 - std::sys::backtrace::_print_fmt
                       at /checkout/library/std/src/sys/backtrace.rs:66:9
   4:   0xd8d8d6 - <std::sys::backtrace::BacktraceLock<'_>::print::DisplayBacktrace as std::fmt::Display>::fmt
                       at /checkout/library/std/src/sys/backtrace.rs:39:26
---
  12:   0x1cae8d - std::panicking::rust_panic_with_hook
                       at /checkout/library/std/src/panicking.rs:833:13
  13:   0x1c9a48 - std::panicking::begin_panic_handler::{closure#0}
                       at /checkout/library/std/src/panicking.rs:699:13
  14:   0xd8ebc0 - std::sys::backtrace::__rust_end_short_backtrace::<{closure@std::panicking::begin_panic_handler::{closure#0}}, !>
                       at /checkout/library/std/src/sys/backtrace.rs:168:18
  15:   0x1c99e8 - std::panicking::begin_panic_handler
                       at /checkout/library/std/src/panicking.rs:697:5
  16:   0x18fe8d - core::panicking::panic_nounwind_fmt::runtime
                       at /checkout/library/core/src/panicking.rs:117:22
  17:   0x392257 - core::panicking::panic_nounwind_fmt
                       at /checkout/library/core/src/intrinsics/mod.rs:3241:9
---
  28:    0x9170e - std::panic::catch_unwind::<&dyn std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe, i32>
                       at /checkout/library/std/src/panic.rs:359:14
  29:   0x1a853c - std::rt::lang_start_internal::{closure#0}
                       at /checkout/library/std/src/rt.rs:175:24
  30:   0x1c8c14 - std::panicking::r#try::do_call::<{closure@std::rt::lang_start_internal::{closure#0}}, isize>
                       at /checkout/library/std/src/panicking.rs:589:40
  31:   0x1c859c - std::panicking::r#try::<isize, {closure@std::rt::lang_start_internal::{closure#0}}>
                       at /checkout/library/std/src/panicking.rs:552:19
  32:    0x91740 - std::panic::catch_unwind::<{closure@std::rt::lang_start_internal::{closure#0}}, isize>
                       at /checkout/library/std/src/panic.rs:359:14
  33:   0x1a84c8 - std::rt::lang_start_internal
                       at /checkout/library/std/src/rt.rs:171:5
  34:   0x1a8984 - std::rt::lang_start::<()>
                       at /checkout/library/std/src/rt.rs:205:5
---
   = note: BACKTRACE:
   = note: inside `std::sys::pal::windows::abort_internal` at /checkout/library/std/src/sys/pal/windows/mod.rs:359:5: 359:31
   = note: inside `std::panicking::rust_panic_with_hook` at /checkout/library/std/src/panicking.rs:855:9: 855:37
   = note: inside closure at /checkout/library/std/src/panicking.rs:699:13: 704:14
   = note: inside `std::sys::backtrace::__rust_end_short_backtrace::<{closure@std::panicking::begin_panic_handler::{closure#0}}, !>` at /checkout/library/std/src/sys/backtrace.rs:168:18: 168:21
   = note: inside `std::panicking::begin_panic_handler` at /checkout/library/std/src/panicking.rs:697:5: 713:7
   = note: inside `core::panicking::panic_nounwind` at /checkout/library/core/src/panicking.rs:218:5: 218:91
   = note: inside `core::panicking::panic_cannot_unwind` at /checkout/library/core/src/panicking.rs:323:5: 323:61
note: inside `nounwind`
  --> tests/fail/function_calls/exported_symbol_bad_unwind2.rs:11:1
   |
LL | / extern "C-unwind" fn nounwind() {
LL | |     panic!();
LL | | }
   | |_^
note: inside `main`
  --> tests/fail/function_calls/exported_symbol_bad_unwind2.rs:20:14
---

Location:
   /cargo/registry/src/index.crates.io-1949cf8c6b5b557f/ui_test-0.29.2/src/lib.rs:369

Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.
error: test failed, to rerun pass `--test ui`

Caused by:
  process didn't exit successfully: `/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-tools/x86_64-unknown-linux-gnu/release/deps/ui-61361ede30d1eec5` (exit status: 1)
Command has failed. Rerun with -v to see more details.
Build completed unsuccessfully in 0:01:43
  local time: Sat Mar 29 13:11:03 UTC 2025
  network time: Sat, 29 Mar 2025 13:11:03 GMT
##[error]Process completed with exit code 1.
Post job cleanup.

Comment on lines +333 to +337
/// In Windows 8 and later, this will terminate the process immediately without
/// running any in-process exception handlers. In earlier versions of Windows,
/// this sequence of instructions will be treated as an access violation,
/// terminating the process but without necessarily bypassing all exception
/// handlers.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// In Windows 8 and later, this will terminate the process immediately without
/// running any in-process exception handlers. In earlier versions of Windows,
/// this sequence of instructions will be treated as an access violation,
/// terminating the process but without necessarily bypassing all exception
/// handlers.
/// In Windows 8 and later, this will terminate the process immediately,
/// bypassing all in-process exception handlers. In earlier versions of Windows,
/// this sequence of instructions will be treated as an access violation,
/// terminating the process but without necessarily bypassing all exception
/// handlers.

Let's use the same verb both times, otherwise this is unnecessarily confusing since it uses "without" twice to actually make statements that are opposites of each other.

@@ -1,6 +1,6 @@
//@error-in-other-file: the program aborted execution
//@normalize-stderr-test: "\| +\^+" -> "| ^"
//@normalize-stderr-test: "unsafe \{ libc::abort\(\); \}|core::intrinsics::abort\(\);" -> "ABORT();"
//@normalize-stderr-test: "unsafe \{ libc::abort\(\) \}|core::intrinsics::abort\(\)" -> "ABORT()"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
//@normalize-stderr-test: "unsafe \{ libc::abort\(\) \}|core::intrinsics::abort\(\)" -> "ABORT()"
//@normalize-stderr-test: "unsafe \{ libc::abort\(\) \}|crate::intrinsics::abort\(\)" -> "ABORT()"

Copy link
Contributor

@tgross35 tgross35 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will be a nice cleanup. Cc @bjorn3 since this makes some use of internal symbol mangling changes.

Overall looks pretty good to me, @rustbot author for the CI failure

Comment on lines +120 to +123
// Note: contrary to the `__rust_abort` in `crate::rt`, this uses `no_mangle`
// because it is actually used from C code. Because symbols annotated with
// #[rustc_std_internal_symbol] get mangled, this will not lead to linker
// conflicts.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could they get different symbol names? Having the same extern signature reused but distinguished by attributes is a bit tricky.

@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 8, 2025
@rustbot
Copy link
Collaborator

rustbot commented Apr 8, 2025

Reminder, once the PR becomes ready for a review, use @rustbot ready.

@rustbot rustbot added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Apr 8, 2025
@bjorn3
Copy link
Member

bjorn3 commented Apr 9, 2025

Makes sense for now. In the future maybe we could make panic_abort and panic_unwind depend on std rather than the other way around. Both of them are only used with std, but currently std has a kind of weak dependency on panic_abort and panic_unwind where both get registered into the crate store (and thus for example participate in the duplicate lang item check), but only one of the two will actually "activated" and end up getting linked in the end. Flipping the dependency around would allow getting rid of this weird dependency state and allow directly using libstd symbols from both crates.

@bors
Copy link
Collaborator

bors commented Apr 13, 2025

☔ The latest upstream changes (presumably #139746) made this pull request unmergeable. Please resolve the merge conflicts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
O-hermit Operating System: Hermit O-SGX Target: SGX O-windows Operating system: Windows S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants