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

Add option to translate enum integer types to native Rust integer types #2004

Merged
merged 1 commit into from Mar 14, 2021

Conversation

jethrogb
Copy link
Contributor

Fixes #430

@jethrogb jethrogb force-pushed the jb/enum-translate-type branch 2 times, most recently from 1e6de44 to 1fc3aca Compare March 10, 2021 13:38
@@ -2543,6 +2543,8 @@ impl<'a> EnumBuilder<'a> {
},

EnumVariation::Rust { .. } => {
// `repr` is guaranteed to be Rustified in Enum::codegen
attrs.insert(0, quote! { #[repr( #repr )] });
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Using insert instead of push to avoid having to update lots of test cases.

@bors-servo
Copy link

☔ The latest upstream changes (presumably 7286c81) made this pull request unmergeable. Please resolve the merge conflicts.

Copy link
Contributor

@emilio emilio left a comment

Choose a reason for hiding this comment

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

Looks sensible, thanks!

@emilio emilio merged commit dedbea5 into rust-lang:master Mar 14, 2021
bors bot added a commit to fortanix/rust-mbedtls that referenced this pull request Apr 6, 2021
152: Update bindgen r=raoulstrackx a=jethrogb

I took some time this week to make the necessary bindgen changes (rust-lang/rust-bindgen#2004 rust-lang/rust-bindgen#2006 rust-lang/rust-bindgen#2007). This PR updates the bindgen build to use that.

Breaking changes:
* unnamed types are renamed
* C-unions are now actual unions
  * [x] the field accessor functions that used to exist are easy enough to add back
* bitfields are done differently now
* some fn-ptrs are now unsafe
* some fns and fn-ptrs now take const pointers as arguments
* havege.c and timing.c are now not compiled on non-unix platforms, i.e. SGX (probably wasn't working properly anyway)

Fixes #5 #14 #61 #72 #88 #121

Co-authored-by: Jethro Beekman <jethro@fortanix.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

rust_enums missing
4 participants