8000 Remove alignment restriction on RawArrayView/Mut by jturner314 · Pull Request #738 · rust-ndarray/ndarray · GitHub
[go: up one dir, main page]

Skip to content

Remove alignment restriction on RawArrayView/Mut#738

Merged
bluss merged 1 commit intorust-ndarray:masterfrom
jturner314:relax-alignment
Oct 10, 2019
Merged

Remove alignment restriction on RawArrayView/Mut#738
bluss merged 1 commit intorust-ndarray:masterfrom
jturner314:relax-alignment

Conversation

@jturner314
Copy link
Member
@jturner314 jturner314 commented Oct 2, 2019

This makes .cast() safe without a check for alignment.

This might be a breaking change because we documented that RawArrayView/Mut had alignment requirements. I suppose it depends on how that statement could be interpreted. Someone could think that it would mean that, given any RawArrayView, it would be safe to call .deref_into_view() without ensuring that the pointer was aligned. IMO, though, since we didn't say exactly what the alignment restrictions were, no one should have made that assumption.

@bluss
Copy link
Member
bluss commented Oct 9, 2019

Thanks a lot. I patched it to use as for raw pointer casts, the cast method on raw pointers was a Rust 1.37 or 1.38 feature apparently (and it was a bit earlier on NonNull).

@bluss
Copy link
Member
bluss commented Oct 10, 2019

I don't see it as a breaking change, this refinement of detail seems reasonable.

@bluss bluss merged commit 6ee8853 into rust-ndarray:master Oct 10, 2019
@jturner314 jturner314 deleted the relax-alignment branch October 10, 2019 20:56
@jturner314
Copy link
Member Author

Okay, sounds good. Thanks for fixing up the PR for Rust 1.37.

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.

2 participants

0