Skip to content

Commit 9c5b446

Browse files
authored
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
2 parents 6bca11e + 8d0a0b0 commit 9c5b446

File tree

3 files changed

+3
-8
lines changed

3 files changed

+3
-8
lines changed

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -175,9 +175,9 @@ extern "system" {
175175
pub fn WakeByAddressAll(address: *const c_void);
176176
}
177177

178+
// These are loaded by `load_synch_functions`.
178179
#[cfg(target_vendor = "win7")]
179180
compat_fn_optional! {
180-
crate::sys::compat::load_synch_functions();
181181
pub fn WaitOnAddress(
182182
address: *const c_void,
183183
compareaddress: *const c_void,

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

+2-6
Original file line numberDiff line numberDiff line change
@@ -198,11 +198,10 @@ macro_rules! compat_fn_with_fallback {
198198

199199
/// Optionally loaded functions.
200200
///
201-
/// Actual loading of the function defers to $load_functions.
201+
/// Relies on the functions being pre-loaded elsewhere.
202202
#[cfg(target_vendor = "win7")]
203203
macro_rules! compat_fn_optional {
204-
($load_functions:expr;
205-
$(
204+
($(
206205
$(#[$meta:meta])*
207206
$vis:vis fn $symbol:ident($($argname:ident: $argtype:ty),*) $(-> $rettype:ty)?;
208207
)+) => (
@@ -221,9 +220,6 @@ macro_rules! compat_fn_optional {
221220

222221
#[inline(always)]
223222
pub fn option() -> Option<F> {
224-
// Miri does not understand the way we do preloading
225-
// therefore load the function here instead.
226-
#[cfg(miri)] $load_functions;
227223
NonNull::new(PTR.load(Ordering::Relaxed)).map(|f| unsafe { mem::transmute(f) })
228224
}
229225
}

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

-1
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,6 @@ pub fn abort_internal() -> ! {
346346
}
347347
}
348348

349-
// miri is sensitive to changes here so check that miri is happy if touching this
350349
#[cfg(miri)]
351350
pub fn abort_internal() -> ! {
352351
crate::intrinsics::abort();

0 commit comments

Comments
 (0)