transmute: fix check for whether newtypes have equal size#155418
transmute: fix check for whether newtypes have equal size#155418RalfJung wants to merge 1 commit intorust-lang:mainfrom
Conversation
|
r? @JohnTitor rustbot has assigned @JohnTitor. Use Why was this reviewer chosen?The reviewer was selected based on:
|
| if int.is_some() | ||
| || align.is_some() | ||
| || pack.is_some() | ||
| || flags.difference(ReprFlags::IS_TRANSPARENT) != Default::default() |
There was a problem hiding this comment.
FWIW repr(C) is probably sometimes okay, but this code also handles enums with null pointer optimization and there repr(C) is definitely not okay.
|
@bors try |
This comment has been minimized.
This comment has been minimized.
transmute: fix check for whether newtypes have equal size
This comment has been minimized.
This comment has been minimized.
|
That's strange, I thought I had fixed this and it worked locally...
|
|
@RalfJung IIRC, the target that failed has Edit: Yup. #t-compiler/help > `Span` is 96 bits? |
|
Ah! There's a "randomize layout" flag. That should not affect crater though so we can go ahead and |
|
👌 Experiment ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more |
f5db719 to
9d897cb
Compare
|
Actually, there's another flag we should ignore, and it's set on @craterbot abort |
This comment has been minimized.
This comment has been minimized.
transmute: fix check for whether newtypes have equal size
|
🗑️ Experiment ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more |
9d897cb to
c634619
Compare
|
@rustbot reroll |
|
@craterbot check |
|
👌 Experiment ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more |
Fixes #155412
Fixes #88290
I manually checked that the playground example linked in #88290 now emits all three expected errors (and we have equivalent cases in the tests, either preexisting or added by this PR, so it didn't seem worth adding that example as well).