-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Struct undef repr #16499
Struct undef repr #16499
Conversation
if variants.len() != 0 { | ||
let repr_hints = lookup_repr_hints(cx, did); | ||
if repr_hints.len() > 1 { | ||
// this is an error later on, but this type isn't safe |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this actually need special handling?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Possibly. Anything that queries type_contents for this but doesn't actually run trans is going to run up against this, I believe. (The error is in adt, iirc)
As of RFC 18, struct layout is undefined. Opting into a C-compatible struct layout is now down with #[repr(C)]. For consistency, specifying a packed layout is now also down with #[repr(packed)]. Both can be specified. To fix errors caused by this, just add #[repr(C)] to the structs, and change #[packed] to #[repr(packed)] Closes #14309 [breaking-change]
int/uint aren't considered FFI safe, replace them with the actual type they represent (i64/u64 or i32/u32). This is a breaking change, but at most a cast to `uint` or `int` needs to be added. [breaking-change]
The attribute was removed by rust-lang#16499.
The attribute was removed by #16499.
internal: Update rustc_pattern_analysis dependency Just bumping the dependency, as I've been making API changes over on the rustc side. More API changes incoming in the coming weeks. One benefit of this: we no longer abort in the `DeconstructedPat: Debug` impl, which means we can use `tracing` to investigate issues.
r? @pcwalton