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

Represent C-like enums with a plain LLVM integer, not a struct. #10652

Merged
merged 2 commits into from
Nov 26, 2013

Conversation

jld
Copy link
Contributor

@jld jld commented Nov 25, 2013

This is needed so that the FFI works as expected on platforms that don't
flatten aggregates the way the AMD64 ABI does, especially for #[repr(C)].

This moves more of type_of into trans::adt, because the type might
or might not be an LLVM struct.

Closes #10308.

This is needed so that the FFI works as expected on platforms that don't
flatten aggregates the way the AMD64 ABI does, especially for `#[repr(C)]`.

This moves more of `type_of` into `trans::adt`, because the type might
or might not be an LLVM struct.

pub fn main() {
unsafe {
let f: extern "C" fn(uint) -> u32 = std::cast::transmute(foo);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

needs to be ::std::cast::transmute

bors added a commit that referenced this pull request Nov 26, 2013
This is needed so that the FFI works as expected on platforms that don't
flatten aggregates the way the AMD64 ABI does, especially for `#[repr(C)]`.

This moves more of `type_of` into `trans::adt`, because the type might
or might not be an LLVM struct.

Closes #10308.
@bors bors closed this Nov 26, 2013
@bors bors merged commit 0c04a26 into rust-lang:master Nov 26, 2013
flip1995 pushed a commit to flip1995/rust that referenced this pull request Apr 23, 2023
…1995

Clippy Book Chapter Updates Reborn: Macro Expansions

This PR adds a new chapter to the book: "Macro Expansions". There weren't big changes apart from grammar, re-phrasing and stylistic choices.

## Notes

- **Does not require any other chapter** to be merged before this
- To talk about the whole project, please use the tracking issue for the project rust-lang#10597 (It also contains a timeline, discussions and more information)

changelog: Add a new "Macro Expansions" chapter to the book

r? `@flip1995`
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.

Returning an enum in 32-bit FFI is broken
4 participants