Skip to content

Commit 7f09d72

Browse files
Remove build.rs file
1 parent dc32ab9 commit 7f09d72

File tree

3 files changed

+10
-57
lines changed

3 files changed

+10
-57
lines changed

Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ A lightweight logging facade for Rust
1313
categories = ["development-tools::debugging"]
1414
keywords = ["logging"]
1515
exclude = ["rfcs/**/*"]
16-
build = "build.rs"
1716

1817
[package.metadata.docs.rs]
1918
features = ["std", "serde", "kv_unstable_std", "kv_unstable_sval", "kv_unstable_serde"]

build.rs

-46
This file was deleted.

src/lib.rs

+10-10
Original file line numberDiff line numberDiff line change
@@ -342,20 +342,20 @@ mod serde;
342342
#[cfg(feature = "kv_unstable")]
343343
pub mod kv;
344344

345-
#[cfg(has_atomics)]
345+
#[cfg(target_has_atomic = "ptr")]
346346
use std::sync::atomic::{AtomicUsize, Ordering};
347347

348-
#[cfg(not(has_atomics))]
348+
#[cfg(not(target_has_atomic = "ptr"))]
349349
use std::cell::Cell;
350-
#[cfg(not(has_atomics))]
350+
#[cfg(not(target_has_atomic = "ptr"))]
351351
use std::sync::atomic::Ordering;
352352

353-
#[cfg(not(has_atomics))]
353+
#[cfg(not(target_has_atomic = "ptr"))]
354354
struct AtomicUsize {
355355
v: Cell<usize>,
356356
}
357357

358-
#[cfg(not(has_atomics))]
358+
#[cfg(not(target_has_atomic = "ptr"))]
359359
impl AtomicUsize {
360360
const fn new(v: usize) -> AtomicUsize {
361361
AtomicUsize { v: Cell::new(v) }
@@ -369,7 +369,7 @@ impl AtomicUsize {
369369
self.v.set(val)
370370
}
371371

372-
#[cfg(atomic_cas)]
372+
#[cfg(target_has_atomic = "ptr")]
373373
fn compare_exchange(
374374
&self,
375375
current: usize,
@@ -387,7 +387,7 @@ impl AtomicUsize {
387387

388388
// Any platform without atomics is unlikely to have multiple cores, so
389389
// writing via Cell will not be a race condition.
390-
#[cfg(not(has_atomics))]
390+
#[cfg(not(target_has_atomic = "ptr"))]
391391
unsafe impl Sync for AtomicUsize {}
392392

393393
// The LOGGER static holds a pointer to the global logger. It is protected by
@@ -1256,7 +1256,7 @@ pub fn max_level() -> LevelFilter {
12561256
/// An error is returned if a logger has already been set.
12571257
///
12581258
/// [`set_logger`]: fn.set_logger.html
1259-
#[cfg(all(feature = "std", atomic_cas))]
1259+
#[cfg(all(feature = "std", target_has_atomic = "ptr"))]
12601260
pub fn set_boxed_logger(logger: Box<dyn Log>) -> Result<(), SetLoggerError> {
12611261
set_logger_inner(|| Box::leak(logger))
12621262
}
@@ -1314,12 +1314,12 @@ pub fn set_boxed_logger(logger: Box<dyn Log>) -> Result<(), SetLoggerError> {
13141314
/// ```
13151315
///
13161316
/// [`set_logger_racy`]: fn.set_logger_racy.html
1317-
#[cfg(atomic_cas)]
1317+
#[cfg(target_has_atomic = "ptr")]
13181318
pub fn set_logger(logger: &'static dyn Log) -> Result<(), SetLoggerError> {
13191319
set_logger_inner(|| logger)
13201320
}
13211321

1322-
#[cfg(atomic_cas)]
1322+
#[cfg(target_has_atomic = "ptr")]
13231323
fn set_logger_inner<F>(make_logger: F) -> Result<(), SetLoggerError>
13241324
where
13251325
F: FnOnce() -> &'static dyn Log,

0 commit comments

Comments
 (0)