From 3f1d7ac4db988aa299337ae141066d79f6cc217d Mon Sep 17 00:00:00 2001 From: Alec Rohloff Date: Fri, 12 Apr 2024 10:45:07 -0400 Subject: [PATCH] Mitigate MIRI violation --- src/std.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/std.rs b/src/std.rs index 40df429..5c82110 100644 --- a/src/std.rs +++ b/src/std.rs @@ -46,7 +46,8 @@ unsafe impl crate::Impl for StdCriticalSection { // SAFETY: As per the acquire/release safety contract, release can only be called // if the critical section is acquired in the current thread, // in which case we know the GLOBAL_GUARD is initialized. - GLOBAL_GUARD.assume_init_drop(); + #[allow(let_underscore_lock)] + let _ = GLOBAL_GUARD.assume_init_read(); // Note: it is fine to clear this flag *after* releasing the mutex because it's thread local. // No other thread can see its value, there's no potential for races.