impl get_mut_or_init and get_mut_or_try_init for OnceCell and OnceLock by tisonk...
source link: https://github.com/rust-lang/rust/pull/114788
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
impl get_mut_or_init and get_mut_or_try_init for OnceCell and OnceLock #114788
Conversation
Contributor
See also #74465 (comment)
I'm trying to understand the process for such proposal. And I'll appreciate it if anyone can guide me the next step for consensus or adding tests.
Collaborator
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @cuviper (or someone else) soon. Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (
|
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
This comment has been minimized.
Contributor
Something like this needs an API Change Proposal (ACP) - you do that by creating an issue on the libs team repo here https://github.com/rust-lang/libs-team (ACP is one of the templates). |
Contributor
What situation are you trying to solve exactly? (You will need to provide a motivating example in the ACP if you file one). Based on your example on the other thread, this works:
|
Member
@rustbot label +T-libs-api -T-libs |
added T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
and removed T-libs Relevant to the library team, which will review and decide on the PR/issue.
labels
Contributor
Author
But the mut version is awkward:
|
Contributor
Can you post a more complete version of a use case? If you're trying to repeatedly edit data behind Also for your example (in case it's coming from real code), I would not use |
Contributor
Ah, I see your use case here https://github.com/tisonkun/kafka-api/blob/d080ab7e4b57c0ab0182e0b254333f400e616cd2/kafka-api/src/record.rs#L108-L116. It seems like you are happy with using
That makes more sense. If you write an ACP, link it here |
Contributor
Author
@tgross35 Thanks for your review! It seems an ACP is an issue at https://github.com/rust-lang/libs-team/issues/new/choose. If so, let me try to find some time and write a formal proposal. |
Contributor
☔ The latest upstream changes (presumably #116742) made this pull request unmergeable. Please resolve the merge conflicts. |
Member
@tisonkun any updates on the ACP? |
Member
These methods are the equivalent of the |
added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author.
and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
labels
Contributor
Author
Thanks for your reply! Let me file an ACP in this week :D |
Contributor
Author
Breifly outline it here - rust-lang/libs-team#294 Looking forward to your comments and what's the next step I should do. |
Could you please rebase this, and get it to compile?
#114788 (comment) shows the compile error.
added S-waiting-on-ACP Status: PR has an ACP and is waiting for the ACP to complete.
and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author.
labels
Contributor
Author
OK. Let me schedule it in weeks. |
This comment was marked as resolved.
Contributor
Author
@programmerjake would you possibly drop an approval or pull maintainers that can make the decision? I've tried to ask on Zulip. |
Contributor
Please squash this when you get the chance (still looks ok to me) |
sorry, i'm not one of those who can make a decision here, @dtolnay is assigned, if they haven't responded in a month or so you might be able to use some rustbot command to pick a different assignee, though that could also make it take longer since you'd likely be at the back of that new person's queue. |
Contributor
Author
Looks good. Thank you!
Member
@bors r+ |
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
Contributor
Author
Thanks for your review and merge @dtolnay! Two questions here:
|
Member
|
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Successfully merging this pull request may close these issues.
None yet
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK