diff options
| author | bors <bors@rust-lang.org> | 2017-12-21 23:01:27 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2017-12-21 23:01:27 +0000 |
| commit | ba2741594ba2d4de2ad8cea69def6408ff5409af (patch) | |
| tree | 2c17b5743bf95d61eef4f3c307bc2823520d768f /src/liballoc/vec.rs | |
| parent | 250b492052e94d76bd318a4b932159395da55981 (diff) | |
| parent | 0787ad92614df48096dbb5cbd6f2cf7833c97293 (diff) | |
| download | rust-ba2741594ba2d4de2ad8cea69def6408ff5409af.tar.gz rust-ba2741594ba2d4de2ad8cea69def6408ff5409af.zip | |
Auto merge of #46922 - kennytm:rollup, r=kennytm
Rollup of 14 pull requests - Successful merges: #46636, #46780, #46784, #46809, #46814, #46820, #46839, #46847, #46858, #46878, #46884, #46890, #46898, #46918 - Failed merges:
Diffstat (limited to 'src/liballoc/vec.rs')
| -rw-r--r-- | src/liballoc/vec.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/liballoc/vec.rs b/src/liballoc/vec.rs index 67ccb5cab6d..93d7e66b7b2 100644 --- a/src/liballoc/vec.rs +++ b/src/liballoc/vec.rs @@ -224,8 +224,10 @@ use Bound::{Excluded, Included, Unbounded}; /// types inside a `Vec`, it will not allocate space for them. *Note that in this case /// the `Vec` may not report a [`capacity`] of 0*. `Vec` will allocate if and only /// if [`mem::size_of::<T>`]`() * capacity() > 0`. In general, `Vec`'s allocation -/// details are subtle enough that it is strongly recommended that you only -/// free memory allocated by a `Vec` by creating a new `Vec` and dropping it. +/// details are very subtle — if you intend to allocate memory using a `Vec` +/// and use it for something else (either to pass to unsafe code, or to build your +/// own memory-backed collection), be sure to deallocate this memory by using +/// `from_raw_parts` to recover the `Vec` and then dropping it. /// /// If a `Vec` *has* allocated memory, then the memory it points to is on the heap /// (as defined by the allocator Rust is configured to use by default), and its |
