diff options
| author | Mara Bos <m-ou.se@m-ou.se> | 2021-10-12 14:50:46 +0200 |
|---|---|---|
| committer | Mara Bos <m-ou.se@m-ou.se> | 2021-10-12 14:50:46 +0200 |
| commit | 129af049fef9a9de3ffba1f6b26246b02a360de3 (patch) | |
| tree | 233df25ce653bf668cb80d78266a86f97ec890c1 | |
| parent | 1fca2ce9010a581798fa39d1742eddcaada359ad (diff) | |
| download | rust-129af049fef9a9de3ffba1f6b26246b02a360de3.tar.gz rust-129af049fef9a9de3ffba1f6b26246b02a360de3.zip | |
Mention Rust version in Vec::leak docs.
| -rw-r--r-- | library/alloc/src/vec/mod.rs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/library/alloc/src/vec/mod.rs b/library/alloc/src/vec/mod.rs index 30cd95d6959..546cd1f6310 100644 --- a/library/alloc/src/vec/mod.rs +++ b/library/alloc/src/vec/mod.rs @@ -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 |
