From 96aa8211d158a1423657985ac67b98b6593650ff Mon Sep 17 00:00:00 2001 From: Eliza Weisman Date: Thu, 30 Sep 2021 12:42:35 -0700 Subject: [PATCH] core: fix `spin_loop_hint` deprecation (#1603) Allow the deprecated API for now, until the next MSRV bump. Signed-off-by: Eliza Weisman --- tracing-core/src/spin/once.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tracing-core/src/spin/once.rs b/tracing-core/src/spin/once.rs index 0bc47b566a..219eb31540 100644 --- a/tracing-core/src/spin/once.rs +++ b/tracing-core/src/spin/once.rs @@ -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