about summary refs log tree commit diff
path: root/library/std/src/sync/lazy_lock.rs
AgeCommit message (Collapse)AuthorLines
2023-03-29Stabilize a portion of 'once_cell'Trevor Gross-12/+12
Move items not part of this stabilization to 'lazy_cell' or 'once_cell_try'
2023-01-27std: add safety comment in `LazyLock::get`joboet-1/+8
2023-01-27std: fix `Debug` implementation on `LazyLock`joboet-8/+5
2023-01-26std: optimize `LazyLock` sizejoboet-16/+66
2022-12-30Auto merge of #105651 - tgross35:once-cell-inline, r=m-ou-sebors-0/+5
Add #[inline] markers to once_cell methods Added inline markers to all simple methods under the `once_cell` feature. Relates to #74465 and #105587 This should not block #105587
2022-12-27Rollup merge of #103718 - matklad:infer-lazy, r=dtolnayMichael Goulet-4/+1
More inference-friendly API for lazy The signature for new was ``` fn new<F>(f: F) -> Lazy<T, F> ``` Notably, with `F` unconstrained, `T` can be literally anything, and just `let _ = Lazy::new(|| 92)` would not typecheck. This historiacally was a necessity -- `new` is a `const` function, it couldn't have any bounds. Today though, we can move `new` under the `F: FnOnce() -> T` bound, which gives the compiler enough data to infer the type of T from closure.
2022-12-13Add #[inline] marker to OnceCell/LazyCell/OnceLock/LazyLockTrevor Gross-0/+5
2022-11-17Properly link `{Once,Lazy}{Cell,Lock}` in docsMaybe Waffle-1/+3
2022-10-29More inference-friendly API for lazyAleksey Kladov-4/+1
The signature for new was ``` fn new<F>(f: F) -> Lazy<T, F> ``` Notably, with `F` unconstrained, `T` can be literally anything, and just `let _ = Lazy::new(|| 92)` would not typecheck. This historiacally was a necessity -- `new` is a `const` function, it couldn't have any bounds. Today though, we can move `new` under the `F: FnOnce() -> T` bound, which gives the compiler enough data to infer the type of T from closure.
2022-06-16Move/rename `lazy::Sync{OnceCell,Lazy}` to `sync::{Once,Lazy}Lock`Maybe Waffle-0/+121