Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove alignment restriction on RawArrayView/Mut #738

Merged
merged 1 commit into from
Oct 10, 2019

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