Skip to content

Commit eba02e8

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 eba02e8

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
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 {

0 commit comments

Comments
 (0)