-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
rename get_{ref, mut} to assume_init_{ref,mut} in Maybeuninit #76047
Conversation
library/core/src/mem/maybe_uninit.rs
Outdated
@@ -624,14 +624,14 @@ impl<T> MaybeUninit<T> { | |||
/// let b = MaybeUninit::<Cell<bool>>::uninit(); | |||
/// // Initialize the `MaybeUninit` using `Cell::set`: | |||
/// unsafe { | |||
/// b.get_ref().set(true); | |||
/// b.assume_init_ref().set(true); | |||
/// // ^^^^^^^^^^^ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The ^
here do not match the code above any more.
Thanks a lot for picking this up @Dylan-DPC :) |
@bors r=RalfJung |
📌 Commit 943911c has been approved by |
☀️ Test successful - checks-actions, checks-azure |
Tested on commit rust-lang/rust@d9cd4a3. Direct link to PR: <rust-lang/rust#76047> 💔 miri on windows: test-pass → test-fail (cc @oli-obk @eddyb @RalfJung). 💔 miri on linux: test-pass → test-fail (cc @oli-obk @eddyb @RalfJung).
rename MaybeUninit slice methods The `first` methods conceptually point to the whole slice, not just its first element, so rename them to be consistent with the raw ptr methods on ref-slices. Also, do the equivalent of rust-lang#76047 for the slice reference getters, and make them part of rust-lang#63569 (so far they somehow had no tracking issue). * first_ptr -> slice_as_ptr * first_ptr_mut -> slice_as_mut_ptr * slice_get_ref -> slice_assume_init_ref * slice_get_mut -> slice_assume_init_mut
rename MaybeUninit slice methods The `first` methods conceptually point to the whole slice, not just its first element, so rename them to be consistent with the raw ptr methods on ref-slices. Also, do the equivalent of rust-lang#76047 for the slice reference getters, and make them part of rust-lang#63569 (so far they somehow had no tracking issue). * first_ptr -> slice_as_ptr * first_ptr_mut -> slice_as_mut_ptr * slice_get_ref -> slice_assume_init_ref * slice_get_mut -> slice_assume_init_mut
rename MaybeUninit slice methods The `first` methods conceptually point to the whole slice, not just its first element, so rename them to be consistent with the raw ptr methods on ref-slices. Also, do the equivalent of rust-lang#76047 for the slice reference getters, and make them part of rust-lang#63569 (so far they somehow had no tracking issue). * first_ptr -> slice_as_ptr * first_ptr_mut -> slice_as_mut_ptr * slice_get_ref -> slice_assume_init_ref * slice_get_mut -> slice_assume_init_mut
rename MaybeUninit slice methods The `first` methods conceptually point to the whole slice, not just its first element, so rename them to be consistent with the raw ptr methods on ref-slices. Also, do the equivalent of rust-lang#76047 for the slice reference getters, and make them part of rust-lang#63569 (so far they somehow had no tracking issue). * first_ptr -> slice_as_ptr * first_ptr_mut -> slice_as_mut_ptr * slice_get_ref -> slice_assume_init_ref * slice_get_mut -> slice_assume_init_mut
… r=RalfJung Stabilize `maybe_uninit_ref` This stabilizes `assume_init_{ref,mut}`. FCP is complete: rust-lang#63568 (comment) The renaming was done by rust-lang#76047 and FIXME was resolved by rust-lang#76241, so I think we can now stabilize them finally 🎉 Still, it's const-unstable as `assert_inhabited` is unstable. Closes rust-lang#63568
References #63568
Rework with comments addressed from #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)