mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-01 06:51:58 +00:00
Clarify documentation
This commit is contained in:
parent
dad049cb5c
commit
1750c7bdd3
@ -194,11 +194,10 @@ where
|
||||
);
|
||||
}
|
||||
|
||||
// Drop any remaining values at the tail of the source but prevent drop of the allocation
|
||||
// itself once IntoIter goes out of scope.
|
||||
// If the drop panics then we also try to drop the destination buffer and its elements.
|
||||
// The ownership of the allocation and the new `T` values is temporarily moved into `dst_guard`.
|
||||
// This is safe because `forget_allocation_drop_remaining` immediately forgets the allocation
|
||||
// and won't panic before that.
|
||||
// before any panic can occur in order to avoid any double free, and then proceeds to drop
|
||||
// any remaining values at the tail of the source.
|
||||
//
|
||||
// Note: This access to the source wouldn't be allowed by the TrustedRandomIteratorNoCoerce
|
||||
// contract (used by SpecInPlaceCollect below). But see the "O(1) collect" section in the
|
||||
|
Loading…
Reference in New Issue
Block a user