add comment to RawVec::cap field

This commit is contained in:
The 8472 2023-04-29 21:47:24 +02:00
parent 502df1b7d4
commit 6a2f44e9d8

View File

@ -60,6 +60,11 @@ impl Cap {
#[allow(missing_debug_implementations)]
pub(crate) struct RawVec<T, A: Allocator = Global> {
ptr: Unique<T>,
/// Never used for ZSTs; it's `capacity()`'s responsibility to return usize::MAX in that case.
///
/// # Safety
///
/// `cap` must be in the `0..=isize::MAX` range.
cap: Cap,
alloc: A,
}