Skip to content

Commit

Permalink
Merge pull request #543 from GuillaumeGomez/rm-build-rs
Browse files Browse the repository at this point in the history
Remove build.rs file
  • Loading branch information
KodrAus committed Apr 10, 2023
2 parents d9cc4e5 + 0fe18a4 commit 474699a
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 61 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Expand Up @@ -127,8 +127,8 @@ jobs:
- uses: actions/checkout@master
- name: Install Rust
run: |
rustup update 1.31.0 --no-self-update
rustup default 1.31.0
rustup update 1.60.0 --no-self-update
rustup default 1.60.0
- run: cargo build --verbose
- run: cargo build --verbose --features serde
- run: cargo build --verbose --features std
Expand Down
1 change: 0 additions & 1 deletion Cargo.toml
Expand Up @@ -13,7 +13,6 @@ A lightweight logging facade for Rust
categories = ["development-tools::debugging"]
keywords = ["logging"]
exclude = ["rfcs/**/*"]
build = "build.rs"

[package.metadata.docs.rs]
features = ["std", "serde", "kv_unstable_std", "kv_unstable_sval", "kv_unstable_serde"]
Expand Down
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -18,7 +18,7 @@ implementation that is most suitable for its use case.

## Minimum supported `rustc`

`1.31.0+`
`1.60.0+`

This version is explicitly tested in CI and may be bumped in any release as needed. Maintaining compatibility with older compilers is a priority though, so the bar for bumping the minimum supported version is set very high. Any changes to the supported minimum version will be called out in the release notes.

Expand Down
46 changes: 0 additions & 46 deletions build.rs

This file was deleted.

2 changes: 1 addition & 1 deletion clippy.toml
@@ -1 +1 @@
msrv = "1.31.0"
msrv = "1.60.0"
20 changes: 10 additions & 10 deletions src/lib.rs
Expand Up @@ -344,20 +344,20 @@ mod serde;
#[cfg(feature = "kv_unstable")]
pub mod kv;

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

#[cfg(not(has_atomics))]
#[cfg(not(target_has_atomic = "ptr"))]
use std::cell::Cell;
#[cfg(not(has_atomics))]
#[cfg(not(target_has_atomic = "ptr"))]
use std::sync::atomic::Ordering;

#[cfg(not(has_atomics))]
#[cfg(not(target_has_atomic = "ptr"))]
struct AtomicUsize {
v: Cell<usize>,
}

#[cfg(not(has_atomics))]
#[cfg(not(target_has_atomic = "ptr"))]
impl AtomicUsize {
const fn new(v: usize) -> AtomicUsize {
AtomicUsize { v: Cell::new(v) }
Expand All @@ -371,7 +371,7 @@ impl AtomicUsize {
self.v.set(val)
}

#[cfg(atomic_cas)]
#[cfg(target_has_atomic = "ptr")]
fn compare_exchange(
&self,
current: usize,
Expand All @@ -389,7 +389,7 @@ impl AtomicUsize {

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

// The LOGGER static holds a pointer to the global logger. It is protected by
Expand Down Expand Up @@ -1258,7 +1258,7 @@ pub fn max_level() -> LevelFilter {
/// An error is returned if a logger has already been set.
///
/// [`set_logger`]: fn.set_logger.html
#[cfg(all(feature = "std", atomic_cas))]
#[cfg(all(feature = "std", target_has_atomic = "ptr"))]
pub fn set_boxed_logger(logger: Box<dyn Log>) -> Result<(), SetLoggerError> {
set_logger_inner(|| Box::leak(logger))
}
Expand Down Expand Up @@ -1316,12 +1316,12 @@ pub fn set_boxed_logger(logger: Box<dyn Log>) -> Result<(), SetLoggerError> {
/// ```
///
/// [`set_logger_racy`]: fn.set_logger_racy.html
#[cfg(atomic_cas)]
#[cfg(target_has_atomic = "ptr")]
pub fn set_logger(logger: &'static dyn Log) -> Result<(), SetLoggerError> {
set_logger_inner(|| logger)
}

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

0 comments on commit 474699a

Please sign in to comment.