Uh oh!
There was an error while loading. Please reload this page.
Mark ZST as FFI-safe if all its fields are PhantomData - #106675
Conversation
rustbot
commented
Jan 10, 2023
r? @davidtwco (rustbot has picked a reviewer for you, use r? to override) |
davidtwco
left a comment
There was a problem hiding this comment.
This is a good start, thanks for the contribution, left some comments below.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
davidtwco
commented
Jan 10, 2023
@rustbot author (use |
0272d23 to
27c5684Comparekrtab
commented
Jan 10, 2023
I think the new version takes into account your points 2 and 3, and I answered 1 above. LMKWYT |
27c5684 to
50b53caComparekrtab
commented
Jan 10, 2023
@rustbot ready |
50b53ca to
f5ab431Comparedavidtwco
commented
Jan 10, 2023
There's a test failing, after you fix that then I can approve :) |
krtab
commented
Jan 10, 2023
This is a bit above my pay-grade: The test failing is basically: #[repr(transparent)]enumTransparentEnum<T>{Variant(T, std::marker::PhantomData<Z>),}which fails because it is an enum with a PhantomData, triggering this code path I'm not sure which one is the correct behavior. Should it have been considered not FFI safe since the beginning, or is this PR introducing a new false positive? |
krtab
commented
Jan 10, 2023
I've pushed a fix for the failing test but I'll leave it to you to decide which is the correct behavior. @rustbot ready |
Uh oh!
There was an error while loading. Please reload this page.
It this is ok for you, I guess all is left is for me to squash that into a single commit and mark the PR as not draft. |
davidtwco
commented
Jan 11, 2023
Works for me :) |
1722028 to
574a31fComparekrtab
commented
Jan 11, 2023
Looks like we're good to go! |
davidtwco
commented
Jan 12, 2023
In fact, one last thing, can you add a test case for #106629? |
574a31f to
27a4e17Comparekrtab
commented
Jan 12, 2023
My bad, I also forgot to do it! |
davidtwco
commented
Jan 12, 2023
Tests were moved from |
Modify the linting behavior and add the corresponding regression test
27a4e17 to
797f247Comparedavidtwco
commented
Jan 12, 2023
@bors r+ |
bors
commented
Jan 12, 2023
Rollup of 8 pull requests Successful merges: - rust-lang#105795 (Stabilize `abi_efiapi` feature) - rust-lang#106446 ([LSDA] Take ttype_index into account when taking unwind action) - rust-lang#106675 (Mark ZST as FFI-safe if all its fields are PhantomData) - rust-lang#106740 (Adding a hint on iterator type errors) - rust-lang#106741 (Fix reexport of `doc(hidden)` item) - rust-lang#106759 (Revert "Make nested RPITIT inherit the parent opaque's generics.") - rust-lang#106772 (Re-add mw to review rotation) - rust-lang#106778 (Exclude formatting commit from blame) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
This presents one possible solution to issue: #106629.
This is my first (tentative) contribution to the compiler itself.
I'm looking forward for comments and feedback
Closes: #106629