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

Struct undef repr #16499

Merged
merged 9 commits into from
Aug 21, 2014
Merged

Struct undef repr #16499

merged 9 commits into from
Aug 21, 2014

Conversation

emberian
Copy link
Member

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
Copy link
Member

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?

Copy link
Member Author

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]
@bors bors closed this Aug 21, 2014
@bors bors merged commit 01d2efa into rust-lang:master Aug 21, 2014
klutzy added a commit to klutzy/rust that referenced this pull request May 17, 2015
bors added a commit that referenced this pull request May 18, 2015
matthiaskrgr pushed a commit to matthiaskrgr/rust that referenced this pull request Feb 11, 2024
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.
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.

4 participants