Skip to content

Commit 12c6c12

Browse files
committed
Replace deprecated spin_loop_hint.
sled requires Rust 1.62+ and `spin_loop` is availabe starting in 1.42.
1 parent 005c023 commit 12c6c12

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

src/backoff.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
/// Vendored and simplified from crossbeam-utils
22
use core::cell::Cell;
3-
use core::sync::atomic;
43

54
const SPIN_LIMIT: u32 = 6;
65

@@ -31,9 +30,7 @@ impl Backoff {
3130
#[inline]
3231
pub fn spin(&self) {
3332
for _ in 0..1 << self.step.get().min(SPIN_LIMIT) {
34-
// `hint::spin_loop` requires Rust 1.49.
35-
#[allow(deprecated)]
36-
atomic::spin_loop_hint();
33+
core::hint::spin_loop();
3734
}
3835

3936
if self.step.get() <= SPIN_LIMIT {

src/concurrency_control.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,7 @@ impl ConcurrencyControl {
6464
if self.active.fetch_or(RW_REQUIRED_BIT, SeqCst) < RW_REQUIRED_BIT {
6565
// we are the first to set this bit
6666
while self.active.load(Acquire) != RW_REQUIRED_BIT {
67-
// `hint::spin_loop` requires Rust 1.49.
68-
#[allow(deprecated)]
69-
std::sync::atomic::spin_loop_hint()
67+
std::hint::spin_loop()
7068
}
7169
self.upgrade_complete.store(true, Release);
7270
}

0 commit comments

Comments
 (0)