diff --git a/CHANGELOG.md b/CHANGELOG.md index 0cb846a..66d27e6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ - +## 1.19.0 + +- Use `portable-atomic` instead of `atomic-polyfill`, [#251](https://github.com/matklad/once_cell/pull/251). + ## 1.18.0 - `MSRV` is updated to 1.60.0 to take advantage of `dep:` syntax for cargo features, diff --git a/Cargo.lock.msrv b/Cargo.lock.msrv index 08e2a1e..d3f878f 100644 --- a/Cargo.lock.msrv +++ b/Cargo.lock.msrv @@ -11,15 +11,6 @@ dependencies = [ "memchr", ] -[[package]] -name = "atomic-polyfill" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c314e70d181aa6053b26e3f7fbf86d1dfff84f816a6175b967666b3506ef7289" -dependencies = [ - "critical-section", -] - [[package]] name = "bitflags" version = "1.3.2" @@ -52,11 +43,11 @@ checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" [[package]] name = "once_cell" -version = "1.18.0" +version = "1.19.0" dependencies = [ - "atomic-polyfill", "critical-section", "parking_lot_core", + "portable-atomic", "regex", ] @@ -73,6 +64,12 @@ dependencies = [ "windows-sys", ] +[[package]] +name = "portable-atomic" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7170ef9988bc169ba16dd36a7fa041e5c4cbeb6a35b76d4c03daded371eae7c0" + [[package]] name = "redox_syscall" version = "0.2.16" diff --git a/Cargo.toml b/Cargo.toml index 9d4189b..e41e06e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "once_cell" -version = "1.18.0" +version = "1.19.0" authors = ["Aleksey Kladov "] license = "MIT OR Apache-2.0" edition = "2021" @@ -21,7 +21,7 @@ members = ["xtask"] [dependencies] parking_lot_core = { version = "0.9.3", optional = true, default_features = false } -atomic-polyfill = { version = "1", optional = true } +portable-atomic = { version = "1", optional = true } critical-section = { version = "1", optional = true } [dev-dependencies] @@ -48,7 +48,7 @@ parking_lot = ["dep:parking_lot_core"] # Uses `critical-section` to implement `sync` and `race` modules. in # `#![no_std]` mode. Please read `critical-section` docs carefully # before enabling this feature. -critical-section = ["dep:critical-section", "dep:atomic-polyfill" ] +critical-section = ["dep:critical-section", "portable-atomic" ] # Enables semver-exempt APIs of this crate. # At the moment, this feature is unused. diff --git a/src/imp_cs.rs b/src/imp_cs.rs index 04018f1..7d05e50 100644 --- a/src/imp_cs.rs +++ b/src/imp_cs.rs @@ -1,6 +1,6 @@ use core::panic::{RefUnwindSafe, UnwindSafe}; -use atomic_polyfill::{AtomicBool, Ordering}; +use portable_atomic::{AtomicBool, Ordering}; use critical_section::{CriticalSection, Mutex}; use crate::unsync; diff --git a/src/race.rs b/src/race.rs index fe36fa1..da8a2fc 100644 --- a/src/race.rs +++ b/src/race.rs @@ -20,7 +20,7 @@ //! architectures versus `Relaxed`. #[cfg(feature = "critical-section")] -use atomic_polyfill as atomic; +use portable_atomic as atomic; #[cfg(not(feature = "critical-section"))] use core::sync::atomic;