mirror of
https://gitee.com/openharmony/third_party_rust_once_cell
synced 2024-11-27 01:21:23 +00:00
fae9f73da6
Like OnceBox, but stores a shared reference instead of a Box.
5.5 KiB
5.5 KiB
Changelog
Unreleased
1.17.0
- Add
race::OnceRef
for storing a&'a T
.
1.16.0
- Add
no_std
implementation based oncritical-section
, #195. - Deprecate
atomic-polyfill
feature (use the newcritical-section
instead)
1.15.0
- Increase minimal supported Rust version to 1.56.0.
- Implement
UnwindSafe
even if thestd
feature is disabled.
1.14.0
- Add extension to
unsync
andsync
Lazy
mut API:force_mut
get_mut
1.13.1
- Make implementation compliant with strict provenance.
- Upgrade
atomic-polyfill
to1.0
1.13.0
- Add
Lazy::get
, similar toOnceCell::get
.
1.12.1
- Remove incorrect
debug_assert
.
1.12.0
- Add
OnceCell::wait
, a blocking variant ofget
.
1.11.0
- 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!
1.10.0
- upgrade
parking_lot
to0.12.0
(note that this bumps MSRV withparking_lot
feature enabled to1.49.0
).
1.9.0
- Added an
atomic-polyfill
optional dependency to compilerace
on platforms without atomics
1.8.0
- Add
try_insert
API -- a version ofset
that returns a reference.
1.7.2
- Improve code size when using parking_lot feature.
1.7.1
- Fix
race::OnceBox<T>
to also implDefault
even ifT
doesn't implDefault
.
1.7.0
- 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.
1.6.0
- 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
.
1.5.2
OnceBox
API usesBox<T>
. This a breaking change to unstable API.
1.5.1
- MSRV is increased to
1.36.0
. - document
once_cell::race
module. - introduce
alloc
feature forOnceBox
. - fix
OnceBox::set
.
1.5.0
- 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.
1.4.1
- 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
1.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
.
1.3.1
- remove unnecessary
F: fmt::Debug
bound fromimpl fmt::Debug for Lazy<T, F>
.
1.3.0
Lazy<T>
now implementsDerefMut
.- update implementation according to the latest changes in
std
.
1.2.0
- add
sync::OnceCell::get_unchecked
.
1.1.0
- implement
Default
forLazy
: it creates an emptyLazy<T>
which is initialized withT::default
on first access. - add
OnceCell::get_mut
.
1.0.2
- actually add
#![no_std]
attribute if std feature is not enabled.
1.0.1
- 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.
1.0.0
- 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.
0.2.7
- 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.
0.2.6
- Updated
Lazy
'sDeref
impl to requires onlyFnOnce
instead ofFn
0.2.5
Lazy
requires onlyFnOnce
instead ofFn
0.2.4
- nicer
fmt::Debug
implementation
0.2.3
- update
parking_lot
to0.9.0
- fix stacked borrows violation in
unsync::OnceCell::get
- implement
Clone
forsync::OnceCell<T> where T: Clone
0.2.2
- add
OnceCell::into_inner
which consumes a cell and returns an option
0.2.1
- 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
0.2.0
- MSRV is now 1.31.1
Lazy::new
andOnceCell::new
are now const-fnsunsync_lazy
andsync_lazy
macros are removed
0.1.8
- update crossbeam-utils to 0.6
- enable bors-ng
0.1.7
- cells implement
PartialEq
andFrom
- MSRV is down to 1.24.1
- update
parking_lot
to0.7.1
0.1.6
unsync::OnceCell<T>
isClone
ifT
isClone
.
0.1.5
- No changelog until this point :(