Skip to content

Initialize directly in From<T> for OnceLock<T>#158101

Merged
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
cuviper:once_lock-from
Jun 19, 2026
Merged

Initialize directly in From<T> for OnceLock<T>#158101
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
cuviper:once_lock-from

Conversation

@cuviper

@cuviper cuviper commented Jun 18, 2026

Copy link
Copy Markdown
Member

There's no need to jump through all the hoops of set when we are
creating a new OnceLock from scratch.

There's no need to jump through all the hoops of `set` when we are
creating a new `OnceLock` from scratch.
@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 Jun 18, 2026
@rustbot

rustbot commented Jun 18, 2026

Copy link
Copy Markdown
Collaborator

r? @Mark-Simulacrum

rustbot has assigned @Mark-Simulacrum.
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

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: @ChrisDenton, libs
  • @ChrisDenton, libs expanded to 12 candidates
  • Random selection from Darksonn, Mark-Simulacrum, clarfonthey, jhpratt

@tgross35 tgross35 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Happened to see this from the ACP discussion,
r? me
@bors r+ rollup

View changes since this review

@rust-bors

rust-bors Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

📌 Commit f57fb8e has been approved by tgross35

It is now in the queue for this repository.

@rust-bors rust-bors Bot added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Jun 18, 2026
@rust-bors rust-bors Bot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jun 18, 2026
rust-bors Bot pushed a commit that referenced this pull request Jun 18, 2026
Rollup of 2 pull requests

Successful merges:

 - #158026 (`RegionValues`: disable unnecessary range check)
 - #158101 (Initialize directly in `From<T> for OnceLock<T>`)
@rust-bors rust-bors Bot merged commit 1191a9d into rust-lang:main Jun 19, 2026
13 checks passed
rust-timer added a commit that referenced this pull request Jun 19, 2026
Rollup merge of #158101 - cuviper:once_lock-from, r=tgross35

Initialize directly in `From<T> for OnceLock<T>`

There's no need to jump through all the hoops of `set` when we are
creating a new `OnceLock` from scratch.
@rustbot rustbot added this to the 1.98.0 milestone Jun 19, 2026
github-actions Bot pushed a commit to rust-lang/stdarch that referenced this pull request Jun 19, 2026
Rollup of 2 pull requests

Successful merges:

 - rust-lang/rust#158026 (`RegionValues`: disable unnecessary range check)
 - rust-lang/rust#158101 (Initialize directly in `From<T> for OnceLock<T>`)
jhpratt added a commit to jhpratt/rust that referenced this pull request Jun 20, 2026
Use the direct `From` in `Clone for OnceLock<T>`

This is a followup to rust-lang#158101 as again, the complexity of `set` is not necessary here, especially because we can now use that direct `From`.

r? tgross35
rust-timer added a commit that referenced this pull request Jun 20, 2026
Rollup merge of #158157 - cuviper:once_lock-clone, r=tgross35

Use the direct `From` in `Clone for OnceLock<T>`

This is a followup to #158101 as again, the complexity of `set` is not necessary here, especially because we can now use that direct `From`.

r? tgross35
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.

4 participants