-
Notifications
You must be signed in to change notification settings - Fork 13.9k
Open
Labels
C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCT-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.disposition-mergeThis issue / PR is in PFCP or FCP with a disposition to merge it.This issue / PR is in PFCP or FCP with a disposition to merge it.finished-final-comment-periodThe final comment period is finished for this PR / Issue.The final comment period is finished for this PR / Issue.to-announceAnnounce this issue on triage meetingAnnounce this issue on triage meeting
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/Cellget_mut()andDerefMutlibs-team#429 - Implementation:
- Final comment period (FCP)1
- Stabilization PR
Unresolved Questions
- None yet.
Footnotes
nazar-pc, Chaoses-Ib and Aseminaunz
Metadata
Metadata
Assignees
Labels
C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCT-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.disposition-mergeThis issue / PR is in PFCP or FCP with a disposition to merge it.This issue / PR is in PFCP or FCP with a disposition to merge it.finished-final-comment-periodThe final comment period is finished for this PR / Issue.The final comment period is finished for this PR / Issue.to-announceAnnounce this issue on triage meetingAnnounce this issue on triage meeting