1
Fork 0

mark vec::IntoIter pointers as !nonnull

This commit is contained in:
The 8472 2023-07-29 16:25:53 +02:00
parent fd8ba7bc3c
commit 93b34a5ffa
6 changed files with 119 additions and 47 deletions

View file

@ -2825,14 +2825,8 @@ impl<T, A: Allocator> IntoIterator for Vec<T, A> {
begin.add(me.len()) as *const T
};
let cap = me.buf.capacity();
IntoIter {
buf: NonNull::new_unchecked(begin),
phantom: PhantomData,
cap,
alloc,
ptr: begin,
end,
}
let buf = NonNull::new_unchecked(begin);
IntoIter { buf, phantom: PhantomData, cap, alloc, ptr: buf, end }
}
}
}