Skip to content

Commit fed3d6e

Browse files
committed
Fix safety section of RawVec::into_box
1 parent cbbdca0 commit fed3d6e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/liballoc/raw_vec.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -574,7 +574,8 @@ impl<T> RawVec<T, Global> {
574574
///
575575
/// # Safety
576576
///
577-
/// * `len` must be smaller than or equal to `self.capacity()`
577+
/// `shrink_to_fit(len)` must be called immediately prior to calling this function. This
578+
/// implies, that `len` must be smaller than or equal to `self.capacity()`.
578579
pub unsafe fn into_box(self, len: usize) -> Box<[MaybeUninit<T>]> {
579580
debug_assert!(
580581
len <= self.capacity(),

0 commit comments

Comments
 (0)