Skip to content

Commit

Permalink
Merge pull request #552 from rust-lang/cargo/0.4.18
Browse files Browse the repository at this point in the history
Prepare for 0.4.19 release
  • Loading branch information
KodrAus authored Jun 11, 2023
2 parents 9ae986d + 5322e56 commit 84ddc30
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 63 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
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 test --verbose --manifest-path tests/Cargo.toml

embedded:
Expand Down
10 changes: 8 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

## [Unreleased]

## [0.4.19] - 2023-06-10

* Use target_has_atomic instead of the old atomic_cas cfg by @GuillaumeGomez in https://github.com/rust-lang/log/pull/555
* Put MSRV into Cargo.toml by @est31 in https://github.com/rust-lang/log/pull/557

## [0.4.18] - 2023-05-28

* fix markdown links (again) by @hellow554 in https://github.com/rust-lang/log/pull/513
Expand All @@ -14,7 +19,6 @@
* GitHub Workflows security hardening by @sashashura in https://github.com/rust-lang/log/pull/538
* Fix build status badge by @atouchet in https://github.com/rust-lang/log/pull/539
* Add call_logger to the documentation by @a1ecbr0wn in https://github.com/rust-lang/log/pull/547
* Remove build.rs file by @GuillaumeGomez in https://github.com/rust-lang/log/pull/543
* Use stable internals for key-value API by @KodrAus in https://github.com/rust-lang/log/pull/550
* Change wording of list of implementations by @Thomasdezeeuw in https://github.com/rust-lang/log/pull/553
* Add std-logger to list of implementations by @Thomasdezeeuw in https://github.com/rust-lang/log/pull/554
Expand Down Expand Up @@ -239,7 +243,9 @@ version using log 0.4.x to avoid losing module and file information.

Look at the [release tags] for information about older releases.

[Unreleased]: https://github.com/rust-lang-nursery/log/compare/0.4.17...HEAD
[Unreleased]: https://github.com/rust-lang-nursery/log/compare/0.4.18...HEAD
[0.4.19]: https://github.com/rust-lang-nursery/log/compare/0.4.18...0.4.19
[0.4.18]: https://github.com/rust-lang-nursery/log/compare/0.4.17...0.4.18
[0.4.17]: https://github.com/rust-lang-nursery/log/compare/0.4.16...0.4.17
[0.4.16]: https://github.com/rust-lang-nursery/log/compare/0.4.15...0.4.16
[0.4.15]: https://github.com/rust-lang-nursery/log/compare/0.4.13...0.4.15
Expand Down
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]

name = "log"
version = "0.4.18" # remember to update html_root_url
version = "0.4.19" # remember to update html_root_url
authors = ["The Rust Project Developers"]
license = "MIT OR Apache-2.0"
readme = "README.md"
Expand All @@ -13,7 +13,7 @@ A lightweight logging facade for Rust
categories = ["development-tools::debugging"]
keywords = ["logging"]
exclude = ["rfcs/**/*"]
build = "build.rs"
rust-version = "1.60.0"

[package.metadata.docs.rs]
features = ["std", "serde", "kv_unstable_std", "kv_unstable_sval", "kv_unstable_serde"]
Expand Down
46 changes: 0 additions & 46 deletions build.rs

This file was deleted.

23 changes: 12 additions & 11 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@
#![doc(
html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
html_favicon_url = "https://www.rust-lang.org/favicon.ico",
html_root_url = "https://docs.rs/log/0.4.18"
html_root_url = "https://docs.rs/log/0.4.19"
)]
#![warn(missing_docs)]
#![deny(missing_debug_implementations, unconditional_recursion)]
Expand All @@ -346,20 +346,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 @@ -373,7 +373,7 @@ impl AtomicUsize {
self.v.set(val)
}

#[cfg(atomic_cas)]
#[cfg(target_has_atomic = "ptr")]
fn compare_exchange(
&self,
current: usize,
Expand All @@ -391,7 +391,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 @@ -1219,6 +1219,7 @@ where
///
/// Note that `Trace` is the maximum level, because it provides the maximum amount of detail in the emitted logs.
#[inline]
#[cfg(target_has_atomic = "ptr")]
pub fn set_max_level(level: LevelFilter) {
MAX_LOG_LEVEL_FILTER.store(level as usize, Ordering::Relaxed);
}
Expand Down Expand Up @@ -1287,7 +1288,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 @@ -1345,12 +1346,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 84ddc30

Please sign in to comment.