core: fix spin_loop_hint deprecation (#1603)

Allow the deprecated API for now, until the next MSRV bump.

Signed-off-by: Eliza Weisman <eliza@buoyant.io>
This commit is contained in:
Eliza Weisman 2021-09-30 12:42:35 -07:00
parent 700fd15055
commit ee2f67c667

View File

@ -1,6 +1,9 @@
use core::cell::UnsafeCell;
use core::fmt;
use core::sync::atomic::{spin_loop_hint as cpu_relax, AtomicUsize, Ordering};
use core::sync::atomic::{AtomicUsize, Ordering};
// TODO(eliza): replace with `core::hint::spin_loop` once our MSRV supports it.
#[allow(deprecated)]
use core::sync::atomic::spin_loop_hint as cpu_relax;
/// A synchronization primitive which can be used to run a one-time global
/// initialization. Unlike its std equivalent, this is generalized so that the