Rollup merge of #131644 - RalfJung:win-miri, r=joboet

Clean up some Miri things in `sys/windows`

- remove miri hack that is only needed for win7 (we don't support win7 as a target in Miri)
- remove outdated comment now that Miri is on CI
This commit is contained in:
Matthias Krüger 2024-10-13 18:27:21 +02:00 committed by GitHub
commit 9c5b4460dd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 3 additions and 8 deletions

View File

@ -175,9 +175,9 @@ pub fn WaitOnAddress(
pub fn WakeByAddressAll(address: *const c_void); pub fn WakeByAddressAll(address: *const c_void);
} }
// These are loaded by `load_synch_functions`.
#[cfg(target_vendor = "win7")] #[cfg(target_vendor = "win7")]
compat_fn_optional! { compat_fn_optional! {
crate::sys::compat::load_synch_functions();
pub fn WaitOnAddress( pub fn WaitOnAddress(
address: *const c_void, address: *const c_void,
compareaddress: *const c_void, compareaddress: *const c_void,

View File

@ -198,11 +198,10 @@ pub unsafe fn call($($argname: $argtype),*) -> $rettype {
/// Optionally loaded functions. /// Optionally loaded functions.
/// ///
/// Actual loading of the function defers to $load_functions. /// Relies on the functions being pre-loaded elsewhere.
#[cfg(target_vendor = "win7")] #[cfg(target_vendor = "win7")]
macro_rules! compat_fn_optional { macro_rules! compat_fn_optional {
($load_functions:expr; ($(
$(
$(#[$meta:meta])* $(#[$meta:meta])*
$vis:vis fn $symbol:ident($($argname:ident: $argtype:ty),*) $(-> $rettype:ty)?; $vis:vis fn $symbol:ident($($argname:ident: $argtype:ty),*) $(-> $rettype:ty)?;
)+) => ( )+) => (
@ -221,9 +220,6 @@ pub mod $symbol {
#[inline(always)] #[inline(always)]
pub fn option() -> Option<F> { pub fn option() -> Option<F> {
// Miri does not understand the way we do preloading
// therefore load the function here instead.
#[cfg(miri)] $load_functions;
NonNull::new(PTR.load(Ordering::Relaxed)).map(|f| unsafe { mem::transmute(f) }) NonNull::new(PTR.load(Ordering::Relaxed)).map(|f| unsafe { mem::transmute(f) })
} }
} }

View File

@ -346,7 +346,6 @@ pub fn abort_internal() -> ! {
} }
} }
// miri is sensitive to changes here so check that miri is happy if touching this
#[cfg(miri)] #[cfg(miri)]
pub fn abort_internal() -> ! { pub fn abort_internal() -> ! {
crate::intrinsics::abort(); crate::intrinsics::abort();