rust-ndarray / ndarray

ndarray: an N-dimensional array with array views, multidimensional slicing, and efficient operations
https://docs.rs/ndarray/
Apache License 2.0
3.63k stars 307 forks source link

Check for aliasing in `RawViewMut::from_shape_ptr` with a debug assertion #1413

Closed bluss closed 3 months ago

bluss commented 3 months ago

It should deny overlapping indexes. Because it's an unsafe function and we only do these checks on best-effort basis (caller has to ensure they are correct), it's a debug assertion.

Removed the small addition to a doc comment that was done in a previous PR (it was an unfinished idea).

Similar to pr #1410 Finishes and closes #919