Skip to content

Allow zero strides on empty arrays - #1611

Open
Guflly wants to merge 1 commit into
rust-ndarray:masterfrom
Guflly:fix/empty-zero-strides
Open

Allow zero strides on empty arrays#1611
Guflly wants to merge 1 commit into
rust-ndarray:masterfrom
Guflly:fix/empty-zero-strides

Conversation

@Guflly

@Guflly Guflly commented Aug 2, 2026

Copy link
Copy Markdown

Treat shapes with an empty axis as non-overlapping when validating mutable views.

This allows zero strides on empty arrays while keeping the existing overlap checks for non-empty shapes.

Fixes #1609

Tests:

  • cargo test -F approx,serde,rayon
  • cargo test --no-default-features
  • cargo +nightly fmt --all --check

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Empty Array lead to "The strides must not allow any element to be referenced by two different indices"

1 participant