- Remove
portable_atomic
from 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
race
module using justportable_atomic
, withoutcritical_section
and provide better error messages on targets without atomic CAS instruction, #265.
- Use
portable-atomic
instead ofatomic-polyfill
, #251.
MSRV
is 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
OnceRef
implementation compliant with strict provenance.
- Add
race::OnceRef
for storing a&'a T
.
- Add
no_std
implementation based oncritical-section
, #195. - Deprecate
atomic-polyfill
feature (use the newcritical-section
instead)
- Increase minimal supported Rust version to 1.56.0.
- Implement
UnwindSafe
even if thestd
feature is disabled.
- Add extension to
unsync
andsync
Lazy
mut API:force_mut
get_mut
- Make implementation compliant with strict provenance.
- Upgrade
atomic-polyfill
to1.0
- Add
Lazy::get
, similar toOnceCell::get
.
- Remove incorrect
debug_assert
.
- Add
OnceCell::wait
, a blocking variant ofget
.
- Add
OnceCell::with_value
to create initializedOnceCell
inconst
context. - Improve
Clone
implementation forOnceCell
. - Rewrite
parking_lot
version on top ofparking_lot_core
, for even smaller cells!
- upgrade
parking_lot
to0.12.0
(note that this bumps MSRV withparking_lot
feature enabled to1.49.0
).
- Added an
atomic-polyfill
optional dependency to compilerace
on platforms without atomics
- Add
try_insert
API -- a version ofset
that returns a reference.
- Improve code size when using parking_lot feature.
- Fix
race::OnceBox<T>
to also implDefault
even ifT
doesn't implDefault
.
- Hide the
race
module behind (default)race
feature. Turns out that addingrace
by 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 userace
withno_default_features
. Given that therace
module itself only several days old, the breakage is deemed acceptable.
- Add
Lazy::into_value
- Stabilize
once_cell::race
module for "first one wins" no_std-compatible initialization flavor. - Migrate from deprecated
compare_and_swap
tocompare_exchange
.
OnceBox
API usesBox<T>
. This a breaking change to unstable API.
- MSRV is increased to
1.36.0
. - document
once_cell::race
module. - introduce
alloc
feature forOnceBox
. - fix
OnceBox::set
.
- add new
once_cell::race
module for "first one wins" no_std-compatible initialization flavor. The API is provisional, subject to change and is gated by theunstable
cargo feature.
- upgrade
parking_lot
to0.11.0
- make
sync::OnceCell<T>
pass https://doc.rust-lang.org/nomicon/dropck.html#an-escape-hatch[dropck] withparking_lot
feature enabled. This fixes a (minor) semver-incompatible changed introduced in1.4.0
- upgrade
parking_lot
to0.10
(note that this bumps MSRV withparking_lot
feature enabled to1.36.0
). - add
OnceCell::take
. - upgrade crossbeam utils (private dependency) to
0.7
.
- remove unnecessary
F: fmt::Debug
bound 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
Default
forLazy
: it creates an emptyLazy<T>
which is initialized withT::default
on 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
RefUnwindSafe
forLazy
. - share more code between
std
andparking_lot
implementations. - add F.A.Q section to the docs.
- remove
parking_lot
from the list of default features. - add
std
default feature. Withoutstd
, onlyunsync
module is supported. - implement
Eq
forOnceCell
. - fix wrong
Sync
bound onsync::Lazy
. - run the whole test suite with miri.
- New implementation of
sync::OnceCell
ifparking_lot
feature is disabled. It now employs a hand-rolled variant ofstd::sync::Once
. sync::OnceCell::get_or_try_init
works withoutparking_lot
as well!- document the effects of
parking_lot
feature: same performance but smaller types.
- Updated
Lazy
'sDeref
impl to requires onlyFnOnce
instead ofFn
Lazy
requires onlyFnOnce
instead ofFn
- nicer
fmt::Debug
implementation
- update
parking_lot
to0.9.0
- fix stacked borrows violation in
unsync::OnceCell::get
- implement
Clone
forsync::OnceCell<T> where T: Clone
- add
OnceCell::into_inner
which consumes a cell and returns an option
- implement
sync::OnceCell::get_or_try_init
ifparking_lot
feature is enabled - switch internal
unsafe
implementation ofsync::OnceCell
fromOnce
toMutex
sync::OnceCell::get_or_init
is twice as fast if cell is already initialized- implement
std::panic::RefUnwindSafe
andstd::panic::UnwindSafe
forOnceCell
- better document behavior around panics
- MSRV is now 1.31.1
Lazy::new
andOnceCell::new
are now const-fnsunsync_lazy
andsync_lazy
macros are removed
- update crossbeam-utils to 0.6
- enable bors-ng
- cells implement
PartialEq
andFrom
- MSRV is down to 1.24.1
- update
parking_lot
to0.7.1
unsync::OnceCell<T>
isClone
ifT
isClone
.
- No changelog until this point :(