matklad / once_cell

Rust library for single assignment cells and lazy statics without macros
Apache License 2.0
1.84k stars 110 forks source link

critical-section vs critical_section #217

Closed rukai closed 1 year ago

rukai commented 1 year ago

Its very easy to accidentally do: once_cell = { version = "1.17.0", default-features = false, features = ["critical_section"] } instead of: once_cell = { version = "1.17.0", default-features = false, features = ["critical-section"] }

The first one enables the dependency critical_section, which effectively does nothing. The second enables the dependency critical_section and enables the actual functionality that makes use of the dependency.

We could solve this by implementing the dep as: critical_section = ["dep:critical_section", "atomic_polyfill" ] but we would have to wait for MSRV to reach 1.60: https://blog.rust-lang.org/2022/04/07/Rust-1.60.0.html#new-syntax-for-cargo-features

matklad commented 1 year ago

fixes on master!