core: clarify MaybeUninit::assume_init UB for uninitialized integers#153253
core: clarify MaybeUninit::assume_init UB for uninitialized integers#153253laddery-a wants to merge 2 commits intorust-lang:mainfrom
Conversation
|
r? @scottmcm rustbot has assigned @scottmcm. Use Why was this reviewer chosen?The reviewer was selected based on:
|
|
When you're done changing things and have squashed the commits and updated the OP comment, use @rustbot author |
|
Reminder, once the PR becomes ready for a review, use |
|
Isn't this being worked on in #153030? |
|
Yeah this is a duplicate. @laddery-a thanks for helping improve our docs! However, before you work on fixing an opened issue, please check that the issue isn't already claimed by someone. #150689 has an assignee so it is clearly claimed. I will therefore close this PR in favor of #153030. Your feedback is welcome on that PR! |
Fixes #150689.
This clarifies in the
MaybeUninit::assume_initsafety docs that callingassume_initon uninitialized memory is immediate UB even whenTis an integer / POD type, and adds a small incorrect-usage example usingu8.