@@ -342,20 +342,20 @@ mod serde;
342
342
#[ cfg( feature = "kv_unstable" ) ]
343
343
pub mod kv;
344
344
345
- #[ cfg( has_atomics ) ]
345
+ #[ cfg( target_has_atomic = "ptr" ) ]
346
346
use std:: sync:: atomic:: { AtomicUsize , Ordering } ;
347
347
348
- #[ cfg( not( has_atomics ) ) ]
348
+ #[ cfg( not( target_has_atomic = "ptr" ) ) ]
349
349
use std:: cell:: Cell ;
350
- #[ cfg( not( has_atomics ) ) ]
350
+ #[ cfg( not( target_has_atomic = "ptr" ) ) ]
351
351
use std:: sync:: atomic:: Ordering ;
352
352
353
- #[ cfg( not( has_atomics ) ) ]
353
+ #[ cfg( not( target_has_atomic = "ptr" ) ) ]
354
354
struct AtomicUsize {
355
355
v : Cell < usize > ,
356
356
}
357
357
358
- #[ cfg( not( has_atomics ) ) ]
358
+ #[ cfg( not( target_has_atomic = "ptr" ) ) ]
359
359
impl AtomicUsize {
360
360
const fn new ( v : usize ) -> AtomicUsize {
361
361
AtomicUsize { v : Cell :: new ( v) }
@@ -369,7 +369,7 @@ impl AtomicUsize {
369
369
self . v . set ( val)
370
370
}
371
371
372
- #[ cfg( atomic_cas ) ]
372
+ #[ cfg( target_has_atomic = "ptr" ) ]
373
373
fn compare_exchange (
374
374
& self ,
375
375
current : usize ,
@@ -387,7 +387,7 @@ impl AtomicUsize {
387
387
388
388
// Any platform without atomics is unlikely to have multiple cores, so
389
389
// writing via Cell will not be a race condition.
390
- #[ cfg( not( has_atomics ) ) ]
390
+ #[ cfg( not( target_has_atomic = "ptr" ) ) ]
391
391
unsafe impl Sync for AtomicUsize { }
392
392
393
393
// The LOGGER static holds a pointer to the global logger. It is protected by
@@ -1256,7 +1256,7 @@ pub fn max_level() -> LevelFilter {
1256
1256
/// An error is returned if a logger has already been set.
1257
1257
///
1258
1258
/// [`set_logger`]: fn.set_logger.html
1259
- #[ cfg( all( feature = "std" , atomic_cas ) ) ]
1259
+ #[ cfg( all( feature = "std" , target_has_atomic = "ptr" ) ) ]
1260
1260
pub fn set_boxed_logger ( logger : Box < dyn Log > ) -> Result < ( ) , SetLoggerError > {
1261
1261
set_logger_inner ( || Box :: leak ( logger) )
1262
1262
}
@@ -1314,12 +1314,12 @@ pub fn set_boxed_logger(logger: Box<dyn Log>) -> Result<(), SetLoggerError> {
1314
1314
/// ```
1315
1315
///
1316
1316
/// [`set_logger_racy`]: fn.set_logger_racy.html
1317
- #[ cfg( atomic_cas ) ]
1317
+ #[ cfg( target_has_atomic = "ptr" ) ]
1318
1318
pub fn set_logger ( logger : & ' static dyn Log ) -> Result < ( ) , SetLoggerError > {
1319
1319
set_logger_inner ( || logger)
1320
1320
}
1321
1321
1322
- #[ cfg( atomic_cas ) ]
1322
+ #[ cfg( target_has_atomic = "ptr" ) ]
1323
1323
fn set_logger_inner < F > ( make_logger : F ) -> Result < ( ) , SetLoggerError >
1324
1324
where
1325
1325
F : FnOnce ( ) -> & ' static dyn Log ,
0 commit comments