319319#![ doc(
320320 html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png" ,
321321 html_favicon_url = "https://www.rust-lang.org/favicon.ico" ,
322- html_root_url = "https://docs.rs/log/0.4.18 "
322+ html_root_url = "https://docs.rs/log/0.4.19 "
323323) ]
324324#![ warn( missing_docs) ]
325325#![ deny( missing_debug_implementations, unconditional_recursion) ]
@@ -346,20 +346,20 @@ mod serde;
346346#[ cfg( feature = "kv_unstable" ) ]
347347pub mod kv;
348348
349- #[ cfg( has_atomics ) ]
349+ #[ cfg( target_has_atomic = "ptr" ) ]
350350use std:: sync:: atomic:: { AtomicUsize , Ordering } ;
351351
352- #[ cfg( not( has_atomics ) ) ]
352+ #[ cfg( not( target_has_atomic = "ptr" ) ) ]
353353use std:: cell:: Cell ;
354- #[ cfg( not( has_atomics ) ) ]
354+ #[ cfg( not( target_has_atomic = "ptr" ) ) ]
355355use std:: sync:: atomic:: Ordering ;
356356
357- #[ cfg( not( has_atomics ) ) ]
357+ #[ cfg( not( target_has_atomic = "ptr" ) ) ]
358358struct AtomicUsize {
359359 v : Cell < usize > ,
360360}
361361
362- #[ cfg( not( has_atomics ) ) ]
362+ #[ cfg( not( target_has_atomic = "ptr" ) ) ]
363363impl AtomicUsize {
364364 const fn new ( v : usize ) -> AtomicUsize {
365365 AtomicUsize { v : Cell :: new ( v) }
@@ -373,7 +373,7 @@ impl AtomicUsize {
373373 self . v . set ( val)
374374 }
375375
376- #[ cfg( atomic_cas ) ]
376+ #[ cfg( target_has_atomic = "ptr" ) ]
377377 fn compare_exchange (
378378 & self ,
379379 current : usize ,
@@ -391,7 +391,7 @@ impl AtomicUsize {
391391
392392// Any platform without atomics is unlikely to have multiple cores, so
393393// writing via Cell will not be a race condition.
394- #[ cfg( not( has_atomics ) ) ]
394+ #[ cfg( not( target_has_atomic = "ptr" ) ) ]
395395unsafe impl Sync for AtomicUsize { }
396396
397397// The LOGGER static holds a pointer to the global logger. It is protected by
@@ -1219,6 +1219,7 @@ where
12191219///
12201220/// Note that `Trace` is the maximum level, because it provides the maximum amount of detail in the emitted logs.
12211221#[ inline]
1222+ #[ cfg( target_has_atomic = "ptr" ) ]
12221223pub fn set_max_level ( level : LevelFilter ) {
12231224 MAX_LOG_LEVEL_FILTER . store ( level as usize , Ordering :: Relaxed ) ;
12241225}
@@ -1287,7 +1288,7 @@ pub fn max_level() -> LevelFilter {
12871288/// An error is returned if a logger has already been set.
12881289///
12891290/// [`set_logger`]: fn.set_logger.html
1290- #[ cfg( all( feature = "std" , atomic_cas ) ) ]
1291+ #[ cfg( all( feature = "std" , target_has_atomic = "ptr" ) ) ]
12911292pub fn set_boxed_logger ( logger : Box < dyn Log > ) -> Result < ( ) , SetLoggerError > {
12921293 set_logger_inner ( || Box :: leak ( logger) )
12931294}
@@ -1345,12 +1346,12 @@ pub fn set_boxed_logger(logger: Box<dyn Log>) -> Result<(), SetLoggerError> {
13451346/// ```
13461347///
13471348/// [`set_logger_racy`]: fn.set_logger_racy.html
1348- #[ cfg( atomic_cas ) ]
1349+ #[ cfg( target_has_atomic = "ptr" ) ]
13491350pub fn set_logger ( logger : & ' static dyn Log ) -> Result < ( ) , SetLoggerError > {
13501351 set_logger_inner ( || logger)
13511352}
13521353
1353- #[ cfg( atomic_cas ) ]
1354+ #[ cfg( target_has_atomic = "ptr" ) ]
13541355fn set_logger_inner < F > ( make_logger : F ) -> Result < ( ) , SetLoggerError >
13551356where
13561357 F : FnOnce ( ) -> & ' static dyn Log ,
0 commit comments