Tracking Issue for `OnceCell/Lock::get_mut_or_init`
Open
Nobody has claimed this yet.
C-tracking-issue
disposition-merge
proposed-final-comment-period
T-libs
- Dominant language
- Rust
- Stars
- 119k
- Forks
- 16.1k
- PR merge metrics
- PR metrics pending
Description
Feature gate: #![feature(once_cell_get_mut)]
This is a tracking issue for
OnceCell::get_mut_or_init()OnceCell::get_mut_or_try_init()OnceLock::get_mut_or_init()OnceLock::get_mut_or_try_init()
Public API
pub fn get_mut_or_try_init<F, E>(&mut self, f: F) -> Result<&mut T, E>
where
F: FnOnce() -> Result<T, E> { ... }
pub fn get_mut_or_init<F>(&mut self, f: F) -> &mut T
where
F: FnOnce() -> T { ... }
Steps / History
- ACP: https://github.com/rust-lang/libs-team/issues/294
- Implementation: https://github.com/rust-lang/rust/pull/114788
- Final comment period (FCP)
- Stabilization PR
Unresolved Questions
None yet.
Footnotes
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Read the stabilization procedure in the Rust Dev Guide and review the completed implementation in rust-lang/rust#114788, along with the ACP in libs-team#294. The tracking issue is done when the final comment period is complete and a stabilization PR has been created and merged.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100