Skip to content

rename get_{ref, mut} to assume_init_{ref,mut} in Maybeuninit #76047

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 5 commits into from
Sep 1, 2020

Conversation

Dylan-DPC-zz
Copy link

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)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 29, 2020
@@ -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);
/// // ^^^^^^^^^^^
Copy link
Member

@RalfJung RalfJung Aug 31, 2020

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.

@RalfJung
Copy link
Member

Thanks a lot for picking this up @Dylan-DPC :)
r=me with the two remaining minor nits resolved.

@Dylan-DPC-zz
Copy link
Author

@bors r=RalfJung

@bors
Copy link
Collaborator

bors commented Aug 31, 2020

📌 Commit 943911c has been approved by RalfJung

@bors bors 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 Aug 31, 2020
@bors
Copy link
Collaborator

bors commented Sep 1, 2020

⌛ Testing commit 943911c with merge d9cd4a3...

@bors bors mentioned this pull request Sep 1, 2020
@bors
Copy link
Collaborator

bors commented Sep 1, 2020

☀️ Test successful - checks-actions, checks-azure
Approved by: RalfJung
Pushing d9cd4a3 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Sep 1, 2020
@bors bors merged commit d9cd4a3 into rust-lang:master Sep 1, 2020
@rust-highfive
Copy link
Contributor

📣 Toolstate changed by #76047!

Tested on commit d9cd4a3.
Direct link to PR: #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).

rust-highfive added a commit to rust-lang-nursery/rust-toolstate that referenced this pull request Sep 1, 2020
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).
matklad added a commit to matklad/rust that referenced this pull request Sep 4, 2020
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
PG-MANA added a commit to PG-MANA/Methylenix that referenced this pull request Sep 4, 2020
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request Sep 5, 2020
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
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request Sep 5, 2020
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
bors added a commit to rust-lang-ci/rust that referenced this pull request Sep 5, 2020
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
bors added a commit to rust-lang-ci/rust that referenced this pull request Jun 14, 2021
… 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
@cuviper cuviper added this to the 1.48.0 milestone Nov 17, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants