1# Changelog 2 3## Unreleased 4 5- 6 7## 1.17.0 8 9- Add `race::OnceRef` for storing a `&'a T`. 10 11## 1.16.0 12 13- Add `no_std` implementation based on `critical-section`, 14 [#195](https://github.com/matklad/once_cell/pull/195). 15- Deprecate `atomic-polyfill` feature (use the new `critical-section` instead) 16 17## 1.15.0 18 19- Increase minimal supported Rust version to 1.56.0. 20- Implement `UnwindSafe` even if the `std` feature is disabled. 21 22## 1.14.0 23 24- Add extension to `unsync` and `sync` `Lazy` mut API: 25 - `force_mut` 26 - `get_mut` 27 28 29## 1.13.1 30 31- Make implementation compliant with [strict provenance](https://github.com/rust-lang/rust/issues/95228). 32- Upgrade `atomic-polyfill` to `1.0` 33 34## 1.13.0 35 36- Add `Lazy::get`, similar to `OnceCell::get`. 37 38## 1.12.1 39 40- Remove incorrect `debug_assert`. 41 42## 1.12.0 43 44- Add `OnceCell::wait`, a blocking variant of `get`. 45 46## 1.11.0 47 48- Add `OnceCell::with_value` to create initialized `OnceCell` in `const` context. 49- Improve `Clone` implementation for `OnceCell`. 50- Rewrite `parking_lot` version on top of `parking_lot_core`, for even smaller cells! 51 52## 1.10.0 53 54- upgrade `parking_lot` to `0.12.0` (note that this bumps MSRV with `parking_lot` feature enabled to `1.49.0`). 55 56## 1.9.0 57 58- Added an `atomic-polyfill` optional dependency to compile `race` on platforms without atomics 59 60## 1.8.0 61 62- Add `try_insert` API -- a version of `set` that returns a reference. 63 64## 1.7.2 65 66- Improve code size when using parking_lot feature. 67 68## 1.7.1 69 70- Fix `race::OnceBox<T>` to also impl `Default` even if `T` doesn't impl `Default`. 71 72## 1.7.0 73 74- Hide the `race` module behind (default) `race` feature. 75 Turns out that adding `race` by default was a breaking change on some platforms without atomics. 76 In this release, we make the module opt-out. 77 Technically, this is a breaking change for those who use `race` with `no_default_features`. 78 Given that the `race` module itself only several days old, the breakage is deemed acceptable. 79 80## 1.6.0 81 82- Add `Lazy::into_value` 83- Stabilize `once_cell::race` module for "first one wins" no_std-compatible initialization flavor. 84- Migrate from deprecated `compare_and_swap` to `compare_exchange`. 85 86## 1.5.2 87 88- `OnceBox` API uses `Box<T>`. 89 This a breaking change to unstable API. 90 91## 1.5.1 92 93- MSRV is increased to `1.36.0`. 94- document `once_cell::race` module. 95- introduce `alloc` feature for `OnceBox`. 96- fix `OnceBox::set`. 97 98## 1.5.0 99 100- add new `once_cell::race` module for "first one wins" no_std-compatible initialization flavor. 101 The API is provisional, subject to change and is gated by the `unstable` cargo feature. 102 103## 1.4.1 104 105- upgrade `parking_lot` to `0.11.0` 106- make `sync::OnceCell<T>` pass https://doc.rust-lang.org/nomicon/dropck.html#an-escape-hatch[dropck] with `parking_lot` feature enabled. 107 This fixes a (minor) semver-incompatible changed introduced in `1.4.0` 108 109## 1.4.0 110 111- upgrade `parking_lot` to `0.10` (note that this bumps MSRV with `parking_lot` feature enabled to `1.36.0`). 112- add `OnceCell::take`. 113- upgrade crossbeam utils (private dependency) to `0.7`. 114 115## 1.3.1 116 117- remove unnecessary `F: fmt::Debug` bound from `impl fmt::Debug for Lazy<T, F>`. 118 119## 1.3.0 120 121- `Lazy<T>` now implements `DerefMut`. 122- update implementation according to the latest changes in `std`. 123 124## 1.2.0 125 126- add `sync::OnceCell::get_unchecked`. 127 128## 1.1.0 129 130- implement `Default` for `Lazy`: it creates an empty `Lazy<T>` which is initialized with `T::default` on first access. 131- add `OnceCell::get_mut`. 132 133## 1.0.2 134 135- actually add `#![no_std]` attribute if std feature is not enabled. 136 137## 1.0.1 138 139- fix unsoundness in `Lazy<T>` if the initializing function panics. Thanks [@xfix](https://github.com/xfix)! 140- implement `RefUnwindSafe` for `Lazy`. 141- share more code between `std` and `parking_lot` implementations. 142- add F.A.Q section to the docs. 143 144## 1.0.0 145 146- remove `parking_lot` from the list of default features. 147- add `std` default feature. Without `std`, only `unsync` module is supported. 148- implement `Eq` for `OnceCell`. 149- fix wrong `Sync` bound on `sync::Lazy`. 150- run the whole test suite with miri. 151 152## 0.2.7 153 154- New implementation of `sync::OnceCell` if `parking_lot` feature is disabled. 155 It now employs a hand-rolled variant of `std::sync::Once`. 156- `sync::OnceCell::get_or_try_init` works without `parking_lot` as well! 157- document the effects of `parking_lot` feature: same performance but smaller types. 158 159## 0.2.6 160 161- Updated `Lazy`'s `Deref` impl to requires only `FnOnce` instead of `Fn` 162 163## 0.2.5 164 165- `Lazy` requires only `FnOnce` instead of `Fn` 166 167## 0.2.4 168 169- nicer `fmt::Debug` implementation 170 171## 0.2.3 172 173- update `parking_lot` to `0.9.0` 174- fix stacked borrows violation in `unsync::OnceCell::get` 175- implement `Clone` for `sync::OnceCell<T> where T: Clone` 176 177## 0.2.2 178 179- add `OnceCell::into_inner` which consumes a cell and returns an option 180 181## 0.2.1 182 183- implement `sync::OnceCell::get_or_try_init` if `parking_lot` feature is enabled 184- switch internal `unsafe` implementation of `sync::OnceCell` from `Once` to `Mutex` 185- `sync::OnceCell::get_or_init` is twice as fast if cell is already initialized 186- implement `std::panic::RefUnwindSafe` and `std::panic::UnwindSafe` for `OnceCell` 187- better document behavior around panics 188 189## 0.2.0 190 191- MSRV is now 1.31.1 192- `Lazy::new` and `OnceCell::new` are now const-fns 193- `unsync_lazy` and `sync_lazy` macros are removed 194 195## 0.1.8 196 197- update crossbeam-utils to 0.6 198- enable bors-ng 199 200## 0.1.7 201 202- cells implement `PartialEq` and `From` 203- MSRV is down to 1.24.1 204- update `parking_lot` to `0.7.1` 205 206## 0.1.6 207 208- `unsync::OnceCell<T>` is `Clone` if `T` is `Clone`. 209 210## 0.1.5 211 212- No changelog until this point :( 213