Skip to content

Commit

Permalink
Rollup merge of rust-lang#93300 - RalfJung:win-abort-miri, r=Amanieu
Browse files Browse the repository at this point in the history
make Windows abort_internal Miri-compatible

rust-lang#92828 started calling `abort_internal` on double-panics, uncovering that on Windows this function does not work in Miri because of its use of inline assembly.

Cc `@Amanieu`
  • Loading branch information
matthiaskrgr authored Jan 25, 2022
2 parents b2c21ab + 53d2401 commit 04f915b
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions library/std/src/sys/windows/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,7 @@ pub fn dur2timeout(dur: Duration) -> c::DWORD {
#[allow(unreachable_code)]
pub fn abort_internal() -> ! {
const FAST_FAIL_FATAL_APP_EXIT: usize = 7;
#[cfg(not(miri))] // inline assembly does not work in Miri
unsafe {
cfg_if::cfg_if! {
if #[cfg(any(target_arch = "x86", target_arch = "x86_64"))] {
Expand Down

0 comments on commit 04f915b

Please sign in to comment.