diff --git a/src/tools/miri/src/shims/native_lib.rs b/src/tools/miri/src/shims/native_lib.rs index 3f47b440f7d0..033e4f367162 100644 --- a/src/tools/miri/src/shims/native_lib.rs +++ b/src/tools/miri/src/shims/native_lib.rs @@ -232,12 +232,9 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> { let (ret, maybe_memevents) = this.call_native_with_args(link_name, dest, code_ptr, libffi_args)?; - #[cfg(target_os = "linux")] - if let Some(events) = maybe_memevents { + if cfg!(target_os = "linux") && let Some(events) = maybe_memevents { trace!("Registered FFI events:\n{events:#0x?}"); } - #[cfg(not(target_os = "linux"))] - let _ = maybe_memevents; // Suppress the unused warning. this.write_immediate(*ret, dest)?; interp_ok(true)