Skip to content

Commit 129af04

Browse files
committed
Mention Rust version in Vec::leak docs.
1 parent 1fca2ce commit 129af04

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

library/alloc/src/vec/mod.rs

+5-4
Original file line numberDiff line numberDiff line change
@@ -1952,10 +1952,11 @@ impl<T, A: Allocator> Vec<T, A> {
19521952
/// `'a`. If the type has only static references, or none at all, then this
19531953
/// may be chosen to be `'static`.
19541954
///
1955-
/// This method does not reallocate or shrink the `Vec`, so the leaked
1956-
/// allocation may include unused capacity that is not part of the returned
1957-
/// slice. Unsafe code that later reconstructs or deallocates the `Vec`
1958-
/// (for example, by calling [`Vec::from_raw_parts`]) must keep track of the
1955+
/// As of Rust 1.57, this method does not reallocate or shrink the `Vec`,
1956+
/// so the leaked allocation may include unused capacity that is not part
1957+
/// of the returned slice.
1958+
/// Unsafe code that later reconstructs or deallocates the `Vec` (for
1959+
/// example, by calling [`Vec::from_raw_parts`]) must keep track of the
19591960
/// original capacity.
19601961
///
19611962
/// This function is mainly useful for data that lives for the remainder of

0 commit comments

Comments
 (0)