about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2022-01-25 23:06:03 +0100
committerGitHub <noreply@github.com>2022-01-25 23:06:03 +0100
commit04f915b33258c98fe8a5061369a7d924e3d2328a (patch)
tree392a6ccc1170c7184662c22c8ad425c0222897ef
parentb2c21abb9c49f1afbf68ecd8f7ea46d219c600b9 (diff)
parent53d2401f3f951a30b5da5941b7b2d7111934cfd9 (diff)
downloadrust-04f915b33258c98fe8a5061369a7d924e3d2328a.tar.gz
rust-04f915b33258c98fe8a5061369a7d924e3d2328a.zip
Rollup merge of #93300 - RalfJung:win-abort-miri, r=Amanieu
make Windows abort_internal Miri-compatible

https://github.com/rust-lang/rust/pull/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`
-rw-r--r--library/std/src/sys/windows/mod.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/library/std/src/sys/windows/mod.rs b/library/std/src/sys/windows/mod.rs
index 084af4325e7..ad4492f9d1f 100644
--- a/library/std/src/sys/windows/mod.rs
+++ b/library/std/src/sys/windows/mod.rs
@@ -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"))] {