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