-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
[WIP] Rename MaybeUninit::get_{ref,mut} to MaybeUninit::assume_init_{ref,mut} #66174
[WIP] Rename MaybeUninit::get_{ref,mut} to MaybeUninit::assume_init_{ref,mut} #66174
Conversation
This is the last remaining concern blocking the stabilization of the by-ref accessors of `MaybeUninit` (rust-lang#63568). This change of name not only does align with `.into_inner()` being called `.assume_init()`, it also conveys the dangerous semantics of the method in a much clearer and more direct way, reducing the change of misuse and thus of unsoundness.
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
Seems there were some errors in other places. Otherwise this looks good. :) |
Likewise; the rename looks good to me but libstd itself actually uses these methods in some places -- incorrectly, FWIW, as things are not yet initialized there. This is old code that was written for |
Then renaming will be a good chance to spot all these usages ;) I don't mind working on more code with you guys overseeing it |
Do we have FIXMEs in these places? If not, I agree that this is a good opportunity to add some. :) |
I think I added FIXMEs to all of them. If @danielhenrymantilla is up for trying to fix them that's even better of course. ;) Here's the first one: Line 15 in 50f8aad
(and there are a few more in that same file, grep for |
Ping from Triage: any updates @danielhenrymantilla? |
Yes, sorry, I have been quite busy as of late, so this is taking longer than intended: as long as this has |
Renaming sounds good to me. I agree that fixing usage in std at the same time would be ideal, thanks for volunteering @danielhenrymantilla! |
Ping from triage: |
Sure! First of all, and I cannot emphasize this enough,
I have only recently stopped being as busy as I've been for the last 3-4 weeks, so I can go back to work on this in more detail. More precisely:
That's why changing this to only relying on
|
I agree with separating out the But no need to close the PR, the rename still makes sense! If you can't get around to fixing all the existing users, that's okay as well, nothing actually gets worse from this PR. If you could fix all users except for |
Going |
I think it is better to split this in separate prs. Closing this. Thanks for taking the time to contribute :) |
Hi, its not clear to me what happened; the issue was closed, but no follow up PR was proposed or done. This feature is now in limbo? |
This is not an issue, it is a PR. It got closed, IMO because of feature creep, and nobody else showed up to finish the work. The feature is still tracked at #63568. |
rename get_{ref, mut} to assume_init_{ref,mut} in Maybeuninit References rust-lang#63568 Rework with comments addressed from rust-lang#66174 Have replaced most of the occurrences I've found, hopefully didn't miss out anything r? @RalfJung (thanks @danielhenrymantilla for the initial work on this)
This is the last remaining concern blocking the stabilization of the by-ref accessors of
MaybeUninit
(#63568).This change of name not only does align with
.into_inner()
being called.assume_init()
,it also conveys the dangerous semantics of the method in a much clearer and more direct way,
reducing the change of misuse and thus of unsoundness.
r? @RalfJung cc @SimonSapin @Centril