From a45974a1818c4b3a4b278f783837abba28fe4622 Mon Sep 17 00:00:00 2001 From: Nathan Goldbaum Date: Fri, 1 Nov 2024 19:21:12 -0600 Subject: [PATCH] ignore clippy MSRV lint --- src/sync.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/sync.rs b/src/sync.rs index 26e9bbd4c6d..7c5c7b033d5 100644 --- a/src/sync.rs +++ b/src/sync.rs @@ -550,6 +550,9 @@ impl OnceLockExt for std::sync::OnceLock { where F: FnOnce() -> T, { + // this trait is guarded by a rustc version config + // so clippy's MSRV check is wrong + #[allow(clippy::incompatible_msrv)] // Use self.get() first to create a fast path when initialized self.get() .unwrap_or_else(|| init_once_lock_py_attached(self, py, f)) @@ -599,6 +602,9 @@ where // SAFETY: we are currently attached to a Python thread let ts_guard = Guard(Some(unsafe { ffi::PyEval_SaveThread() })); + // this trait is guarded by a rustc version config + // so clippy's MSRV check is wrong + #[allow(clippy::incompatible_msrv)] // By having detached here, we guarantee that `.get_or_init` cannot deadlock with // the Python interpreter let value = lock.get_or_init(move || {