Change code for `into_iter` on the `RawVec` section for consistency/soundness (#302)

pull/306/head
zachmatson 3 years ago committed by GitHub
parent 0c7e5bd142
commit 8da31d7a28
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -145,7 +145,12 @@ impl<T> Vec<T> {
IntoIter { IntoIter {
start: buf.ptr.as_ptr(), start: buf.ptr.as_ptr(),
end: buf.ptr.as_ptr().add(len), end: if buf.cap == 0 {
// can't offset off of a pointer unless it's part of an allocation
buf.ptr.as_ptr()
} else {
buf.ptr.as_ptr().add(len)
},
_buf: buf, _buf: buf,
} }
} }

Loading…
Cancel
Save