Skip to content

Add documentation for MaybeUninit<T> - #2393

Merged
traviscross merged 7 commits into
rust-lang:masterfrom
DanielEScherzer:MaybeUninit
Oct 20, 2026
Merged

traviscross merged 7 commits into
rust-lang:masterfrom
DanielEScherzer:MaybeUninit

Conversation

@DanielEScherzer

Copy link
Copy Markdown
Contributor

No description provided.

@rustbot rustbot added the S-waiting-on-review Status: The marked PR is awaiting review from a maintainer label Oct 20, 2026
Comment thread src/behavior-considered-undefined.md Outdated
@traviscross traviscross changed the title Add documentation for std::mem::MaybeUninit<T> Add documentation for MaybeUninit<T> Oct 20, 2026
Comment thread src/special-types-and-traits.md Outdated
Comment thread src/special-types-and-traits.md Outdated
Comment thread src/behavior-considered-undefined.md
@DanielEScherzer
DanielEScherzer force-pushed the MaybeUninit branch 2 times, most recently from cab908b to 334ffa7 Compare October 20, 2026 19:57
@DanielEScherzer

Copy link
Copy Markdown
Contributor Author

MaybeUninit guarantees:

So T-lang already agreed to these guarantees

Comment thread src/glossary.md Outdated
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
traviscross added this pull request to the merge queue Oct 20, 2026
@traviscross

Copy link
Copy Markdown
Contributor

Thanks @DanielEScherzer.

Merged via the queue into rust-lang:master with commit 3989fe9 Oct 20, 2026
8 checks passed
@rustbot rustbot removed the S-waiting-on-review Status: The marked PR is awaiting review from a maintainer label Oct 20, 2026
@DanielEScherzer
DanielEScherzer deleted the MaybeUninit branch October 20, 2026 21:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants