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 Resolved
@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 Resolved
Comment thread src/special-types-and-traits.md Resolved
Comment thread src/behavior-considered-undefined.md Resolved
@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 Resolved
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
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Nov 4, 2026
Update books

## rust-lang/book

1 commits in 1500248d8f230566e4ec9f27fcbb8fe9e2898ab1..2771df165f092a4fbb9f46b5b2e7450f19010adb
2026-10-28 18:58:38 UTC to 2026-10-28 18:58:38 UTC

- Upgrade to rust 1.99.1 (rust-lang/book#4861)

## rust-embedded/book

1 commits in 0789b0f29e73ecb91213cac10ad0eec1b9333770..637b4a0244e16ec391a60184ae0c86b550ffc24b
2026-10-27 19:19:19 UTC to 2026-10-27 19:19:19 UTC

- Replace cty:: with core::ffi:: (rust-embedded/book#422)

## rust-lang/reference

1 commits in 2dafab96d919d6ab2884488e970bf95610ff83eb..3989fe91f1a601b51684a582ad17b2503f221787
2026-10-20 21:23:48 UTC to 2026-10-20 21:23:48 UTC

- Add documentation for `MaybeUninit<T>` (rust-lang/reference#2393)
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Nov 4, 2026
Update books

## rust-lang/book

1 commits in 1500248d8f230566e4ec9f27fcbb8fe9e2898ab1..2771df165f092a4fbb9f46b5b2e7450f19010adb
2026-10-28 18:58:38 UTC to 2026-10-28 18:58:38 UTC

- Upgrade to rust 1.99.1 (rust-lang/book#4861)

## rust-embedded/book

1 commits in 0789b0f29e73ecb91213cac10ad0eec1b9333770..637b4a0244e16ec391a60184ae0c86b550ffc24b
2026-10-27 19:19:19 UTC to 2026-10-27 19:19:19 UTC

- Replace cty:: with core::ffi:: (rust-embedded/book#422)

## rust-lang/reference

1 commits in 2dafab96d919d6ab2884488e970bf95610ff83eb..3989fe91f1a601b51684a582ad17b2503f221787
2026-10-20 21:23:48 UTC to 2026-10-20 21:23:48 UTC

- Add documentation for `MaybeUninit<T>` (rust-lang/reference#2393)
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Nov 4, 2026
Update books

## rust-lang/book

1 commits in 1500248d8f230566e4ec9f27fcbb8fe9e2898ab1..2771df165f092a4fbb9f46b5b2e7450f19010adb
2026-10-28 18:58:38 UTC to 2026-10-28 18:58:38 UTC

- Upgrade to rust 1.99.1 (rust-lang/book#4861)

## rust-embedded/book

1 commits in 0789b0f29e73ecb91213cac10ad0eec1b9333770..637b4a0244e16ec391a60184ae0c86b550ffc24b
2026-10-27 19:19:19 UTC to 2026-10-27 19:19:19 UTC

- Replace cty:: with core::ffi:: (rust-embedded/book#422)

## rust-lang/reference

1 commits in 2dafab96d919d6ab2884488e970bf95610ff83eb..3989fe91f1a601b51684a582ad17b2503f221787
2026-10-20 21:23:48 UTC to 2026-10-20 21:23:48 UTC

- Add documentation for `MaybeUninit<T>` (rust-lang/reference#2393)
@rustbot rustbot added this to the 1.101.0 milestone Nov 5, 2026
rust-bors Bot pushed a commit to rust-lang/rust that referenced this pull request Nov 5, 2026
Rollup merge of #165364 - rustbot:docs-update, r=JohnTitor

Update books

## rust-lang/book

1 commits in 1500248d8f230566e4ec9f27fcbb8fe9e2898ab1..2771df165f092a4fbb9f46b5b2e7450f19010adb
2026-10-28 18:58:38 UTC to 2026-10-28 18:58:38 UTC

- Upgrade to rust 1.99.1 (rust-lang/book#4861)

## rust-embedded/book

1 commits in 0789b0f29e73ecb91213cac10ad0eec1b9333770..637b4a0244e16ec391a60184ae0c86b550ffc24b
2026-10-27 19:19:19 UTC to 2026-10-27 19:19:19 UTC

- Replace cty:: with core::ffi:: (rust-embedded/book#422)

## rust-lang/reference

1 commits in 2dafab96d919d6ab2884488e970bf95610ff83eb..3989fe91f1a601b51684a582ad17b2503f221787
2026-10-20 21:23:48 UTC to 2026-10-20 21:23:48 UTC

- Add documentation for `MaybeUninit<T>` (rust-lang/reference#2393)
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