Skip to content

Commit 72f7c2e

Browse files
authored
Merge pull request #260 from brodycj/propagate-critical-section-to-portable-atomic
propagate critical-section feature selection into portable-atomic; other minor updates for v1.20.0
2 parents c48d3c2 + be6b623 commit 72f7c2e

File tree

6 files changed

+86
-62
lines changed

6 files changed

+86
-62
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44

55
-
66

7+
## 1.20.0
8+
9+
- propagate `critical-section` feature selection into `portable-atomic`; other minor updates [#260](https://github.com/matklad/once_cell/pull/260)
10+
711
## 1.19.0
812

913
- Use `portable-atomic` instead of `atomic-polyfill`, [#251](https://github.com/matklad/once_cell/pull/251).

Cargo.lock.msrv

Lines changed: 65 additions & 52 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "once_cell"
3-
version = "1.19.0"
3+
version = "1.20.0"
44
authors = ["Aleksey Kladov <[email protected]>"]
55
license = "MIT OR Apache-2.0"
66
edition = "2021"
@@ -20,13 +20,13 @@ exclude = ["*.png", "*.svg", "/Cargo.lock.msrv", "rustfmt.toml"]
2020
members = ["xtask"]
2121

2222
[dependencies]
23-
parking_lot_core = { version = "0.9.3", optional = true, default_features = false }
24-
portable-atomic = { version = "1", optional = true }
25-
critical-section = { version = "1", optional = true }
23+
parking_lot_core = { version = "0.9.10", optional = true, default-features = false }
24+
portable-atomic = { version = "1.7", optional = true }
25+
critical-section = { version = "1.1.3", optional = true }
2626

2727
[dev-dependencies]
28-
regex = "1.2.0"
29-
critical-section = { version = "1.1.1", features = ["std"] }
28+
regex = "1.10.6"
29+
critical-section = { version = "1.1.3", features = ["std"] }
3030

3131
[features]
3232
default = ["std"]
@@ -48,7 +48,7 @@ parking_lot = ["dep:parking_lot_core"]
4848
# Uses `critical-section` to implement `sync` and `race` modules. in
4949
# `#![no_std]` mode. Please read `critical-section` docs carefully
5050
# before enabling this feature.
51-
critical-section = ["dep:critical-section", "portable-atomic" ]
51+
critical-section = ["dep:critical-section", "portable-atomic/critical-section"]
5252

5353
# Enables semver-exempt APIs of this crate.
5454
# At the moment, this feature is unused.

src/imp_cs.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use core::panic::{RefUnwindSafe, UnwindSafe};
22

3-
use portable_atomic::{AtomicBool, Ordering};
43
use critical_section::{CriticalSection, Mutex};
4+
use portable_atomic::{AtomicBool, Ordering};
55

66
use crate::unsync;
77

src/race.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@
1919
//! `Acquire` and `Release` have very little performance overhead on most
2020
//! architectures versus `Relaxed`.
2121
22-
#[cfg(feature = "critical-section")]
23-
use portable_atomic as atomic;
2422
#[cfg(not(feature = "critical-section"))]
2523
use core::sync::atomic;
24+
#[cfg(feature = "critical-section")]
25+
use portable_atomic as atomic;
2626

2727
use atomic::{AtomicPtr, AtomicUsize, Ordering};
2828
use core::cell::UnsafeCell;

xtask/src/main.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ fn main() -> xshell::Result<()> {
2121
{
2222
let _s = section("TEST");
2323

24+
cmd!(sh, "cargo test --workspace").run()?;
25+
2426
for &release in &[None, Some("--release")] {
2527
cmd!(sh, "cargo test --features unstable {release...}").run()?;
2628
cmd!(
@@ -41,6 +43,11 @@ fn main() -> xshell::Result<()> {
4143
{
4244
let _s = section("TEST_BETA");
4345
let _e = push_toolchain(&sh, "beta")?;
46+
// TEMPORARY WORKAROUND for Rust compiler issue ref:
47+
// - https://github.com/rust-lang/rust/issues/129352
48+
// - https://github.com/matklad/once_cell/issues/261
49+
let _e = sh.push_env("RUSTFLAGS", "-A unreachable_patterns");
50+
4451
cmd!(sh, "cargo test --features unstable").run()?;
4552
}
4653

0 commit comments

Comments
 (0)