From 85a3ef6783eb1ba35514c023ca717f1ddef3b0bf Mon Sep 17 00:00:00 2001 From: Thomas de Zeeuw Date: Thu, 25 Mar 2021 10:18:02 +0100 Subject: [PATCH] Allow use of deprecated atomic::spin_loop_hint It's replaced by hint::spin_loop, however that has only been stable since 1.49.0. Since we still support 1.31.0 we can't use it. Once the MSRV is updated to 1.49 we can use hint::spin_loop. --- src/lib.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index bbfb1ed31..fd680de75 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1362,6 +1362,8 @@ where } INITIALIZING => { while STATE.load(Ordering::SeqCst) == INITIALIZING { + // TODO: replace with `hint::spin_loop` once MSRV is 1.49.0. + #[allow(deprecated)] std::sync::atomic::spin_loop_hint(); } Err(SetLoggerError(()))