diff --git a/src/backoff.rs b/src/backoff.rs index 46a65d7f4..39126bd82 100644 --- a/src/backoff.rs +++ b/src/backoff.rs @@ -1,6 +1,5 @@ /// Vendored and simplified from crossbeam-utils use core::cell::Cell; -use core::sync::atomic; const SPIN_LIMIT: u32 = 6; @@ -31,9 +30,7 @@ impl Backoff { #[inline] pub fn spin(&self) { for _ in 0..1 << self.step.get().min(SPIN_LIMIT) { - // `hint::spin_loop` requires Rust 1.49. - #[allow(deprecated)] - atomic::spin_loop_hint(); + core::hint::spin_loop(); } if self.step.get() <= SPIN_LIMIT { diff --git a/src/concurrency_control.rs b/src/concurrency_control.rs index df2f0f43a..9ce322863 100644 --- a/src/concurrency_control.rs +++ b/src/concurrency_control.rs @@ -64,9 +64,7 @@ impl ConcurrencyControl { if self.active.fetch_or(RW_REQUIRED_BIT, SeqCst) < RW_REQUIRED_BIT { // we are the first to set this bit while self.active.load(Acquire) != RW_REQUIRED_BIT { - // `hint::spin_loop` requires Rust 1.49. - #[allow(deprecated)] - std::sync::atomic::spin_loop_hint() + std::hint::spin_loop() } self.upgrade_complete.store(true, Release); } @@ -99,9 +97,7 @@ impl ConcurrencyControl { }); self.enable(); while !self.upgrade_complete.load(Acquire) { - // `hint::spin_loop` requires Rust 1.49. - #[allow(deprecated)] - std::sync::atomic::spin_loop_hint() + std::hint::spin_loop() } Protector::Write(self.rw.write()) }