mark vec::IntoIter pointers as !nonnull
This commit is contained in:
parent
fd8ba7bc3c
commit
93b34a5ffa
6 changed files with 119 additions and 47 deletions
|
@ -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 }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue