mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-20 10:55:14 +00:00
Rollup merge of #40333 - tbu-:pr_doc_ptr_write, r=alexcrichton
Clarify handling of `src` in `ptr::write` Fixes #39733.
This commit is contained in:
commit
aea8010098
@ -191,6 +191,10 @@ pub unsafe fn read_unaligned<T>(src: *const T) -> T {
|
||||
/// allocations or resources, so care must be taken not to overwrite an object
|
||||
/// that should be dropped.
|
||||
///
|
||||
/// It does not immediately drop the contents of `src` either; it is rather
|
||||
/// *moved* into the memory location `dst` and will be dropped whenever that
|
||||
/// location goes out of scope.
|
||||
///
|
||||
/// This is appropriate for initializing uninitialized memory, or overwriting
|
||||
/// memory that has previously been `read` from.
|
||||
///
|
||||
|
Loading…
Reference in New Issue
Block a user