Skip to content

Update documentation of OnceLock::get_or_init. #140783

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 10, 2025

Conversation

veluca93
Copy link
Contributor

@veluca93 veluca93 commented May 8, 2025

Explicitly point out that if the function panics the init function might be called multiple times.

Explicitly point out that if the function panics the init function might
be called multiple times.
@rustbot
Copy link
Collaborator

rustbot commented May 8, 2025

r? @jhpratt

rustbot has assigned @jhpratt.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels May 8, 2025
@jhpratt
Copy link
Member

jhpratt commented May 9, 2025

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented May 9, 2025

📌 Commit ae25c39 has been approved by jhpratt

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 9, 2025
Zalathar added a commit to Zalathar/rust that referenced this pull request May 10, 2025
Update documentation of OnceLock::get_or_init.

Explicitly point out that if the function panics the init function might be called multiple times.
bors added a commit to rust-lang-ci/rust that referenced this pull request May 10, 2025
Rollup of 10 pull requests

Successful merges:

 - rust-lang#129334 (Implement (part of) ACP 429: add `DerefMut` to `Lazy[Cell/Lock]`)
 - rust-lang#135015 (Partially stabilize LoongArch target features)
 - rust-lang#138736 (Sanitizers target modificators)
 - rust-lang#139562 (rustdoc: add a handle that makes sidebar resizing more obvious)
 - rust-lang#140151 (remove intrinsics::drop_in_place)
 - rust-lang#140660 (remove 'unordered' atomic intrinsics)
 - rust-lang#140783 (Update documentation of OnceLock::get_or_init.)
 - rust-lang#140789 (Update hermit-abi to 0.5.1)
 - rust-lang#140792 (Use intrinsics for `{f16,f32,f64,f128}::{minimum,maximum}` operations)
 - rust-lang#140862 (Enable non-leaf Frame Pointers for Arm64EC Windows)

r? `@ghost`
`@rustbot` modify labels: rollup
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request May 10, 2025
Update documentation of OnceLock::get_or_init.

Explicitly point out that if the function panics the init function might be called multiple times.
bors added a commit to rust-lang-ci/rust that referenced this pull request May 10, 2025
…iaskrgr

Rollup of 8 pull requests

Successful merges:

 - rust-lang#129334 (Implement (part of) ACP 429: add `DerefMut` to `Lazy[Cell/Lock]`)
 - rust-lang#139562 (rustdoc: add a handle that makes sidebar resizing more obvious)
 - rust-lang#140151 (remove intrinsics::drop_in_place)
 - rust-lang#140660 (remove 'unordered' atomic intrinsics)
 - rust-lang#140783 (Update documentation of OnceLock::get_or_init.)
 - rust-lang#140789 (Update hermit-abi to 0.5.1)
 - rust-lang#140792 (Use intrinsics for `{f16,f32,f64,f128}::{minimum,maximum}` operations)
 - rust-lang#140879 (1.87.0 release notes: remove nonsensical `~` operator)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit to rust-lang-ci/rust that referenced this pull request May 10, 2025
…iaskrgr

Rollup of 7 pull requests

Successful merges:

 - rust-lang#129334 (Implement (part of) ACP 429: add `DerefMut` to `Lazy[Cell/Lock]`)
 - rust-lang#139562 (rustdoc: add a handle that makes sidebar resizing more obvious)
 - rust-lang#140151 (remove intrinsics::drop_in_place)
 - rust-lang#140660 (remove 'unordered' atomic intrinsics)
 - rust-lang#140783 (Update documentation of OnceLock::get_or_init.)
 - rust-lang#140789 (Update hermit-abi to 0.5.1)
 - rust-lang#140879 (1.87.0 release notes: remove nonsensical `~` operator)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 8186b71 into rust-lang:master May 10, 2025
6 checks passed
@rustbot rustbot added this to the 1.89.0 milestone May 10, 2025
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request May 10, 2025
Rollup merge of rust-lang#140783 - veluca93:oncelock-docs, r=jhpratt

Update documentation of OnceLock::get_or_init.

Explicitly point out that if the function panics the init function might be called multiple times.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants