Skip to content

Clarify MaybeUninit::zeroed padding docs#157370

Open
JinRudy wants to merge 1 commit into
rust-lang:mainfrom
JinRudy:docs/maybeuninit-zeroed-padding
Open

Clarify MaybeUninit::zeroed padding docs#157370
JinRudy wants to merge 1 commit into
rust-lang:mainfrom
JinRudy:docs/maybeuninit-zeroed-padding

Conversation

@JinRudy
Copy link
Copy Markdown

@JinRudy JinRudy commented Jun 3, 2026

Closes #111608.

This clarifies that padding bytes in MaybeUninit::zeroed() are not guaranteed to remain zeroed when the MaybeUninit<T> value is returned, matching the existing mem::zeroed documentation that padding is not necessarily zeroed.

Verification:

  • git diff --check
  • ./x fmt --check
  • ./x test tidy
  • ./x test library/core --doc

- 调整 MaybeUninit::zeroed 文档中的 padding 字节说明

- 对齐 mem::zeroed 中不保证 padding 为零的表述
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jun 3, 2026
@rustbot rustbot added the T-libs Relevant to the library team, which will review and decide on the PR/issue. label Jun 3, 2026
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Jun 3, 2026

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @Mark-Simulacrum (or someone else) some time within the next two weeks.

Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (S-waiting-on-review and S-waiting-on-author) stays updated, invoking these commands when appropriate:

  • @rustbot author: the review is finished, PR author should check the comments and take action accordingly
  • @rustbot review: the author is ready for a review, this PR will be queued again in the reviewer's queue
Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: libs
  • libs expanded to 8 candidates
  • Random selection from Mark-Simulacrum, jhpratt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Doc clarification for MaybeUninit::zeroed()

3 participants