Skip to content

Commit

Permalink
Mention Rust version in Vec::leak docs.
Browse files Browse the repository at this point in the history
  • Loading branch information
m-ou-se committed Oct 12, 2021
1 parent 1fca2ce commit 129af04
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions library/alloc/src/vec/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1952,10 +1952,11 @@ impl<T, A: Allocator> Vec<T, A> {
/// `'a`. If the type has only static references, or none at all, then this
/// may be chosen to be `'static`.
///
/// This method does not reallocate or shrink the `Vec`, so the leaked
/// allocation may include unused capacity that is not part of the returned
/// slice. Unsafe code that later reconstructs or deallocates the `Vec`
/// (for example, by calling [`Vec::from_raw_parts`]) must keep track of the
/// As of Rust 1.57, this method does not reallocate or shrink the `Vec`,
/// so the leaked allocation may include unused capacity that is not part
/// of the returned slice.
/// Unsafe code that later reconstructs or deallocates the `Vec` (for
/// example, by calling [`Vec::from_raw_parts`]) must keep track of the
/// original capacity.
///
/// This function is mainly useful for data that lives for the remainder of
Expand Down

0 comments on commit 129af04

Please sign in to comment.