Skip to content

Commit

Permalink
Rollup merge of #95802 - RalfJung:unused-win, r=Dylan-DPC
Browse files Browse the repository at this point in the history
fix unused constant warning on some Windows targets

When none of those `cfg_if!` apply (and on Miri), the constant remains unused.
  • Loading branch information
Dylan-DPC authored Apr 9, 2022
2 parents dfb4194 + 9c97753 commit af895b0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions library/panic_abort/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ pub unsafe extern "C-unwind" fn __rust_start_panic(_payload: *mut &mut dyn BoxMe
//
// Note: this is the same implementation as in libstd's `abort_internal`
unsafe fn abort() -> ! {
#[allow(unused)]
const FAST_FAIL_FATAL_APP_EXIT: usize = 7;
cfg_if::cfg_if! {
if #[cfg(any(target_arch = "x86", target_arch = "x86_64"))] {
Expand Down
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 @@ -289,6 +289,7 @@ pub fn dur2timeout(dur: Duration) -> c::DWORD {
/// that function for more information on `__fastfail`
#[allow(unreachable_code)]
pub fn abort_internal() -> ! {
#[allow(unused)]
const FAST_FAIL_FATAL_APP_EXIT: usize = 7;
#[cfg(not(miri))] // inline assembly does not work in Miri
unsafe {
Expand Down

0 comments on commit af895b0

Please sign in to comment.