about summary refs log tree commit diff
path: root/src/liballoc
diff options
context:
space:
mode:
authorTim Diekmann <tim.diekmann@3dvision.de>2020-03-25 19:12:06 +0100
committerTim Diekmann <tim.diekmann@3dvision.de>2020-03-26 17:13:47 +0100
commitfed3d6e64614adbd7ab4c73b561e48bc2800c899 (patch)
treec39c5fadf6b6c0cebae2e3040c02de7917a56c0b /src/liballoc
parentcbbdca059404a102db9daf2fa50ca8c1c9fc5ad2 (diff)
downloadrust-fed3d6e64614adbd7ab4c73b561e48bc2800c899.tar.gz
rust-fed3d6e64614adbd7ab4c73b561e48bc2800c899.zip
Fix safety section of `RawVec::into_box`
Diffstat (limited to 'src/liballoc')
-rw-r--r--src/liballoc/raw_vec.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/liballoc/raw_vec.rs b/src/liballoc/raw_vec.rs
index cbafeae6417..baa64258057 100644
--- a/src/liballoc/raw_vec.rs
+++ b/src/liballoc/raw_vec.rs
@@ -574,7 +574,8 @@ impl<T> RawVec<T, Global> {
     ///
     /// # Safety
     ///
-    /// * `len` must be smaller than or equal to `self.capacity()`
+    /// `shrink_to_fit(len)` must be called immediately prior to calling this function. This
+    /// implies, that `len` must be smaller than or equal to `self.capacity()`.
     pub unsafe fn into_box(self, len: usize) -> Box<[MaybeUninit<T>]> {
         debug_assert!(
             len <= self.capacity(),