Skip to content

Commit 6d75a22

Browse files
committed
Make miri happy
1 parent c5dda95 commit 6d75a22

File tree

1 file changed

+6
-2
lines changed
  • library/std/src/sys/pal/windows

1 file changed

+6
-2
lines changed

library/std/src/sys/pal/windows/mod.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -321,8 +321,8 @@ pub fn dur2timeout(dur: Duration) -> c::DWORD {
321321
///
322322
/// This is the same implementation as in libpanic_abort's `__rust_start_panic`. See
323323
/// that function for more information on `__fastfail`
324+
#[cfg(not(miri))] // inline assembly does not work in Miri
324325
pub fn abort_internal() -> ! {
325-
#[cfg(not(miri))] // inline assembly does not work in Miri
326326
unsafe {
327327
cfg_if::cfg_if! {
328328
if #[cfg(any(target_arch = "x86", target_arch = "x86_64"))] {
@@ -336,7 +336,11 @@ pub fn abort_internal() -> ! {
336336
}
337337
}
338338
}
339-
#[cfg(miri)]
339+
}
340+
341+
// miri is sensitive to changes here so check miri is happy if touching this
342+
#[cfg(miri)]
343+
pub fn abort_internal() -> ! {
340344
core::intrinsics::abort()
341345
}
342346

0 commit comments

Comments
 (0)