Open
Description
Feature gate: #![feature(lazy_get)]
This is a tracking issue for LazyCell/Lock::get[_mut]()
, allowing you to extract a reference from a Lazy
only if it is initialized, approved in ACP rust-lang/libs-team#429.
Public API
impl<T, F> core::cell::LazyCell<T, F> {
pub fn get(this: &Self) -> Option<&T>;
pub fn get_mut(this: &mut Self) -> Option<&mut T>;
pub fn force_mut(this: &mut Self) -> &mut T;
}
impl<T, F> std::sync::LazyLock<T, F> {
pub fn get(this: &Self) -> Option<&T>;
pub fn get_mut(this: &mut Self) -> Option<&mut T>;
pub fn force_mut(this: &mut Self) -> &mut T;
}
Steps / History
- ACP:
LazyLock/Cell
get_mut()
andDerefMut
libs-team#429 - Implementation:
- Final comment period (FCP)1
- Stabilization PR
Unresolved Questions
- None yet.
Footnotes
Metadata
Metadata
Assignees
Labels
Category: An issue tracking the progress of sth. like the implementation of an RFCRelevant to the library API team, which will review and decide on the PR/issue.This issue / PR is in PFCP or FCP with a disposition to merge it.Proposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off.