Rollup merge of #100893 - thinety:master, r=scottmcm
Remove out-of-context comment in `mem::MaybeUninit` documentation Reverted the comment to an earlier version to avoid confusion: neither raw pointer assignment nor `ptr::write` is used inside the for loop.
This commit is contained in:
commit
683a08af6a
1 changed files with 2 additions and 5 deletions
|
@ -130,11 +130,8 @@ use crate::slice;
|
|||
/// MaybeUninit::uninit().assume_init()
|
||||
/// };
|
||||
///
|
||||
/// // Dropping a `MaybeUninit` does nothing. Thus using raw pointer
|
||||
/// // assignment instead of `ptr::write` does not cause the old
|
||||
/// // uninitialized value to be dropped. Also if there is a panic during
|
||||
/// // this loop, we have a memory leak, but there is no memory safety
|
||||
/// // issue.
|
||||
/// // Dropping a `MaybeUninit` does nothing, so if there is a panic during this loop,
|
||||
/// // we have a memory leak, but there is no memory safety issue.
|
||||
/// for elem in &mut data[..] {
|
||||
/// elem.write(vec![42]);
|
||||
/// }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue