Skip to content

Conversation

@lolbinarycat
Copy link
Contributor

Implementation for #143648

@rustbot
Copy link
Collaborator

rustbot commented Jul 8, 2025

r? @thomcc

rustbot has assigned @thomcc.
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 Jul 8, 2025
@rust-log-analyzer

This comment has been minimized.

@lolbinarycat lolbinarycat force-pushed the core-option_get_or_try_insert_with-143648 branch from f031640 to d09af04 Compare July 8, 2025 20:19
@bors
Copy link
Collaborator

bors commented Jul 18, 2025

☔ The latest upstream changes (presumably #144109) made this pull request unmergeable. Please resolve the merge conflicts.

@lolbinarycat lolbinarycat force-pushed the core-option_get_or_try_insert_with-143648 branch from d09af04 to 9e8f17f Compare July 19, 2025 17:08
@a1phyr
Copy link
Contributor

a1phyr commented Jul 21, 2025

About using the Try trait, we should probably try to be consistent with OnceLock::get_or_try_init. See discussion at #107122.

@lolbinarycat
Copy link
Contributor Author

@a1phyr i initially proposed this as just using Result, it was a t-libs decision to make it use Try.

see rust-lang/libs-team#577 (comment)

Co-authored-by: kennytm <kennytm@gmail.com>
@lolbinarycat lolbinarycat force-pushed the core-option_get_or_try_insert_with-143648 branch from 9e8f17f to b8955c5 Compare August 5, 2025 17:40
@lolbinarycat
Copy link
Contributor Author

reviewer is inactive, rerolling

r? t-libs

@rustbot rustbot assigned the8472 and unassigned thomcc Aug 5, 2025
@wbenny
Copy link

wbenny commented Jan 30, 2026

Can I +1 this PR somehow? :) This would be incredibly useful to have.

@tgross35
Copy link
Contributor

r? libs

@rustbot rustbot assigned jhpratt and unassigned the8472 Jan 30, 2026
@jhpratt
Copy link
Member

jhpratt commented Jan 31, 2026

@bors r+ rollup

@rust-bors
Copy link
Contributor

rust-bors bot commented Jan 31, 2026

📌 Commit b8955c5 has been approved by jhpratt

It is now in the queue for this repository.

@rust-bors rust-bors bot 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 Jan 31, 2026
rust-bors bot pushed a commit that referenced this pull request Jan 31, 2026
Rollup of 5 pull requests

Successful merges:

 - #143650 (core: add Option::get_or_try_insert_with)
 - #151726 (Remove duplicated code in `slice/index.rs`)
 - #151812 (Add `shift_{left,right}` on slices)
 - #151829 (Implement `BinaryHeap::pop_if()`)
 - #151838 (Fix typo for Maybe dangling docs)
@rust-bors rust-bors bot merged commit e142458 into rust-lang:main Jan 31, 2026
10 checks passed
@rustbot rustbot added this to the 1.95.0 milestone Jan 31, 2026
rust-timer added a commit that referenced this pull request Jan 31, 2026
Rollup merge of #143650 - lolbinarycat:core-option_get_or_try_insert_with-143648, r=jhpratt

core: add Option::get_or_try_insert_with

Implementation for #143648
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.

10 participants