| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
The internal Baseiter type underlies most of the ndarray iterators, and it used `*mut A` for element type A. Update it to use `NonNull<A>` which behaves identically except it's guaranteed to be non-null and is covariant w.r.t the parameter A. Add compile test from the issue. Fixes #1290
| // iter is a raw pointer iterator traversing the array in memory order now with the | ||
| // sorted axes. | ||
| let mut iter = Baseiter::new(self_.ptr.as_ptr(), self_.dim, self_.strides); | ||
| let mut iter = Baseiter::new(self_.ptr, self_.dim, self_.strides); |
There was a problem hiding this comment.
Review note: it's evident that Baseiter is constructed from a NonNull everywhere, which means that its non-null requirement is easily fulfilled.
Sorry, something went wrong.
Complete the transition to using NonNull as the raw pointer type by using it as Baseiter's iterator element type.
| Back | FazBrowse Home | New Git URL |
The internal Baseiter type underlies most of the ndarray iterators, and it used *mut A for element type A. Update it to use NonNull<A> which behaves identically except it's guaranteed to be non-null and is covariant w.r.t the parameter A.
Add compile test from the issue.
The second commit continues the "conversion", using NonNull more consistently
in Baseiter's Iterator impl.
Fixes #1290