Skip to content

Upgrading once_cell 0.2 to 1

Breaking0.2.4 → 1.21.4Breaking6Security1Platform7Deprecated1New22Changed11Fixed12Other10

BreakingUpgrade verdict

6 breaking changes and 7 platform requirement changes and a security fix.

  • Remove portable_atomic from Cargo.lock if it is not, in fact, used: This is a work-around for this cargo bug.
  • The `race` module is now only available when the `race` feature is turned on. It is on by default, but if you disable default features you must enable `race` yourself.
  • The parking_lot feature is no longer enabled by default, so users who relied on it must enable it explicitly.
  • The crate now has a std feature that is on by default. If you turn it off, only the unsync module works.
Top 5 of 15 that need code or config changes

Requires Rust 1.65 from 1.21.1 (none stated before).

Breaking6
Remove portable_atomic from Cargo.lock if it is not, in fact, used: This is a work-around for this cargo bug.
portable_atomic
Hides the race module behind a new default race feature, breaking users who enable no_default_features.
race
Removes parking_lot from the list of default features.
parking_lot
Adds a std default feature; without std, only the unsync module is supported.
stdunsync
Changes the unstable OnceBox API to use Box<T>.
OnceBoxBox<T>
Lazy now requires only FnOnce instead of Fn.
LazyFnOnceFn
Security1
Panic during initialization of Lazy<T> might trigger undefined behavior
High · CVSS 7.5
Platform7
Reduce MSRV to 1.65.
Increase MSRV to 1.70.
Updates MSRV to 1.60.0 to use dep: syntax for cargo features, removing implementation details from the public surface.
MSRV
Increases the minimum supported Rust version to 1.56.0.
Upgrades parking_lot to 0.12.0, which bumps the MSRV to 1.49.0 when the parking_lot feature is enabled.
parking_lot
Increases the minimum supported Rust version (MSRV) to 1.36.0.
Upgrades parking_lot to 0.10, which bumps the MSRV to 1.36.0 when the parking_lot feature is enabled.
parking_lot
Deprecated1
Deprecates the atomic-polyfill feature in favor of the new critical-section feature.
atomic-polyfillcritical-section