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 incorrect docs from mem::transmute #22129

Merged
merged 1 commit into from
Feb 10, 2015
Merged

Conversation

steveklabnik
Copy link
Member

Fixes #22032

@rust-highfive
Copy link
Contributor

r? @nikomatsakis

(rust_highfive has picked a reviewer for you, use r? to override)

@alexcrichton
Copy link
Member

@bors: r+ e40d058 rollup

@reem
Copy link
Contributor

reem commented Feb 10, 2015

Is there a reason for this not to be checked at compile time, or just implementation effort?

@steveklabnik
Copy link
Member Author

@reem I asked @huonw if this was a bug or not, and he said that he hoped it wasn't checked, so maybe he can elaborate?

@huonw
Copy link
Member

huonw commented Feb 10, 2015

It doesn't seem to make sense to me for the alignment of the input value to matter for the output (the compiler just has to make sure the memory location storing the output has the right alignment), and it restricts things like transmuting SIMD types to/from arrays/tuples etc, and even say, (u8, u8)u16.

Manishearth added a commit to Manishearth/rust that referenced this pull request Feb 10, 2015
alexcrichton added a commit to alexcrichton/rust that referenced this pull request Feb 10, 2015
@bors bors merged commit e40d058 into rust-lang:master Feb 10, 2015
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.

Docs on std::mem::transmute incorrectly claim the types must have the same alignment
7 participants