diff --git a/src/next_array.rs b/src/next_array.rs index a448194a4..e9747e52c 100644 --- a/src/next_array.rs +++ b/src/next_array.rs @@ -3,8 +3,15 @@ use core::ptr; /// An array of at most `N` elements. struct ArrayBuilder { - arr: [MaybeUninit; N], // Invariant: arr[..len] is valid. - len: usize, // Invariant: len <= N. + /// The (possibly uninitialized) elements of the `ArrayBuilder`. + /// + /// # Safety + /// + /// The elements of `arr[..len]` are valid `T`s. + arr: [MaybeUninit; N], + + /// The number of leading elements of `arr` that are valid `T`s, len <= N. + len: usize, } impl ArrayBuilder {