Repository navigation
Add documentation for MaybeUninit<T> - #2393
Merged
Merged
Conversation
DanielEScherzer
force-pushed
the
MaybeUninit
branch
from
October 20, 2026 18:36
ddd61cc to
77242cd
Compare
traviscross
reviewed
Oct 20, 2026
std::mem::MaybeUninit<T>MaybeUninit<T>
DanielEScherzer
force-pushed
the
MaybeUninit
branch
from
October 20, 2026 19:02
77242cd to
109ccdf
Compare
traviscross
reviewed
Oct 20, 2026
DanielEScherzer
force-pushed
the
MaybeUninit
branch
from
October 20, 2026 19:18
109ccdf to
e6e5482
Compare
traviscross
reviewed
Oct 20, 2026
traviscross
reviewed
Oct 20, 2026
DanielEScherzer
force-pushed
the
MaybeUninit
branch
from
October 20, 2026 19:48
e6e5482 to
81c3cd0
Compare
DanielEScherzer
force-pushed
the
MaybeUninit
branch
2 times, most recently
from
October 20, 2026 19:57
cab908b to
334ffa7
Compare
Contributor
Author
|
MaybeUninit guarantees:
So T-lang already agreed to these guarantees |
traviscross
reviewed
Oct 20, 2026
DanielEScherzer
force-pushed
the
MaybeUninit
branch
from
October 20, 2026 20:01
334ffa7 to
398e5ae
Compare
Let's say this a bit more clearly. (The restatement in `undefined.validity.maybe-uninit` already reads OK.)
The placement of the new items didn't follow the ordering convention used in this list. Let's fix the placement of these.
The proposed wording here was taken from the documentation in the standard library. That text is a bit loose. It says that the type is "used to construct uninitialized values of type `T`", but of course we're using it to construct *initialized* values of type `T`, not *uninitialized* ones. And that's only one use case. It's indeed a bit tricky to concisely describe `MaybeUninit<T>`. Let's try to do a bit better.
traviscross
approved these changes
Oct 20, 2026
Contributor
|
Thanks @DanielEScherzer. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.