Skip to content

Commit 6a2f44e

Browse files
committed
add comment to RawVec::cap field
1 parent 502df1b commit 6a2f44e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

library/alloc/src/raw_vec.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,11 @@ impl Cap {
6060
#[allow(missing_debug_implementations)]
6161
pub(crate) struct RawVec<T, A: Allocator = Global> {
6262
ptr: Unique<T>,
63+
/// Never used for ZSTs; it's `capacity()`'s responsibility to return usize::MAX in that case.
64+
///
65+
/// # Safety
66+
///
67+
/// `cap` must be in the `0..=isize::MAX` range.
6368
cap: Cap,
6469
alloc: A,
6570
}

0 commit comments

Comments
 (0)