-
Fix unsoundness in
OnceCell::waitunder--features=parking_lot, #295.If thread A calls
wait, while thread B callsget_or_try_init(f), and, furthermore,fpanics, thewaitincorrectly returns and thread A observes uninitialized memory.Kudos to @meng-xu-cs for a nice find!
- Relax success ordering from AcqRel to Release in
race: #278.
- Reduce MSRV to 1.65: #277.
- Outline initialization in
race: #273. - Add
OnceNonZereUsize::get_unchecked: #274. - Add
OnceBox::cloneandOnceBox::with_value: #275. - Increase MSRV to 1.70
- Remove
portable_atomicfrom Cargo.lock if it is not, in fact, used: #267 This is a work-around for this cargo bug: rust-lang/cargo#10801.
- Allow using
racemodule using justportable_atomic, withoutcritical_sectionand provide better error messages on targets without atomic CAS instruction, #265.
- Use
portable-atomicinstead ofatomic-polyfill, #251.
MSRVis updated to 1.60.0 to take advantage ofdep:syntax for cargo features, removing "implementation details" from publicly visible surface.
- Avoid unnecessary synchronization in
Lazy::{force,deref}_mut(), #231.
- Make
OnceRefimplementation compliant with strict provenance.
- Add
race::OnceReffor storing a&'a T.
- Add
no_stdimplementation based oncritical-section, #195. - Deprecate
atomic-polyfillfeature (use the newcritical-sectioninstead)
- Increase minimal supported Rust version to 1.56.0.
- Implement
UnwindSafeeven if thestdfeature is disabled.
- Add extension to
unsyncandsyncLazymut API:force_mutget_mut
- Make implementation compliant with strict provenance.
- Upgrade
atomic-polyfillto1.0
- Add
Lazy::get, similar toOnceCell::get.
- Remove incorrect
debug_assert.
- Add
OnceCell::wait, a blocking variant ofget.
- Add
OnceCell::with_valueto create initializedOnceCellinconstcontext. - Improve
Cloneimplementation forOnceCell. - Rewrite
parking_lotversion on top ofparking_lot_core, for even smaller cells!
- upgrade
parking_lotto0.12.0(note that this bumps MSRV withparking_lotfeature enabled to1.49.0).
- Added an
atomic-polyfilloptional dependency to compileraceon platforms without atomics
- Add
try_insertAPI -- a version ofsetthat returns a reference.
- Improve code size when using parking_lot feature.
- Fix
race::OnceBox<T>to also implDefaulteven ifTdoesn't implDefault.
- Hide the
racemodule behind (default)racefeature. Turns out that addingraceby default was a breaking change on some platforms without atomics. In this release, we make the module opt-out. Technically, this is a breaking change for those who useracewithno_default_features. Given that theracemodule itself only several days old, the breakage is deemed acceptable.
- Add
Lazy::into_value - Stabilize
once_cell::racemodule for "first one wins" no_std-compatible initialization flavor. - Migrate from deprecated
compare_and_swaptocompare_exchange.
OnceBoxAPI usesBox<T>. This a breaking change to unstable API.
- MSRV is increased to
1.36.0. - document
once_cell::racemodule. - introduce
allocfeature forOnceBox. - fix
OnceBox::set.
- add new
once_cell::racemodule for "first one wins" no_std-compatible initialization flavor. The API is provisional, subject to change and is gated by theunstablecargo feature.
- upgrade
parking_lotto0.11.0 - make
sync::OnceCell<T>pass https://doc.rust-lang.org/nomicon/dropck.html#an-escape-hatch[dropck] withparking_lotfeature enabled. This fixes a (minor) semver-incompatible changed introduced in1.4.0
- upgrade
parking_lotto0.10(note that this bumps MSRV withparking_lotfeature enabled to1.36.0). - add
OnceCell::take. - upgrade crossbeam utils (private dependency) to
0.7.
- remove unnecessary
F: fmt::Debugbound fromimpl fmt::Debug for Lazy<T, F>.
Lazy<T>now implementsDerefMut.- update implementation according to the latest changes in
std.
- add
sync::OnceCell::get_unchecked.
- implement
DefaultforLazy: it creates an emptyLazy<T>which is initialized withT::defaulton first access. - add
OnceCell::get_mut.
- actually add
#![no_std]attribute if std feature is not enabled.
- fix unsoundness in
Lazy<T>if the initializing function panics. Thanks @xfix! - implement
RefUnwindSafeforLazy. - share more code between
stdandparking_lotimplementations. - add F.A.Q section to the docs.
- remove
parking_lotfrom the list of default features. - add
stddefault feature. Withoutstd, onlyunsyncmodule is supported. - implement
EqforOnceCell. - fix wrong
Syncbound onsync::Lazy. - run the whole test suite with miri.
- New implementation of
sync::OnceCellifparking_lotfeature is disabled. It now employs a hand-rolled variant ofstd::sync::Once. sync::OnceCell::get_or_try_initworks withoutparking_lotas well!- document the effects of
parking_lotfeature: same performance but smaller types.
- Updated
Lazy'sDerefimpl to requires onlyFnOnceinstead ofFn
Lazyrequires onlyFnOnceinstead ofFn
- nicer
fmt::Debugimplementation
- update
parking_lotto0.9.0 - fix stacked borrows violation in
unsync::OnceCell::get - implement
Cloneforsync::OnceCell<T> where T: Clone
- add
OnceCell::into_innerwhich consumes a cell and returns an option
- implement
sync::OnceCell::get_or_try_initifparking_lotfeature is enabled - switch internal
unsafeimplementation ofsync::OnceCellfromOncetoMutex sync::OnceCell::get_or_initis twice as fast if cell is already initialized- implement
std::panic::RefUnwindSafeandstd::panic::UnwindSafeforOnceCell - better document behavior around panics
- MSRV is now 1.31.1
Lazy::newandOnceCell::neware now const-fnsunsync_lazyandsync_lazymacros are removed
- update crossbeam-utils to 0.6
- enable bors-ng
- cells implement
PartialEqandFrom - MSRV is down to 1.24.1
- update
parking_lotto0.7.1
unsync::OnceCell<T>isCloneifTisClone.
- No changelog until this point :(