rustc_target/riscv: Fix passing of transparent unions with only one non-ZST member#115499
Merged
bors merged 2 commits intorust-lang:masterfrom Sep 19, 2023
Merged
Conversation
Contributor
Author
|
@rustbot label +A-abi +O-riscv |
RalfJung
reviewed
Sep 3, 2023
89a24ca to
efd4e62
Compare
Member
|
LGTM but let's get another pair of eyes on it and hopefully someone who knows our process for breaking ABI. This affects r? compiler |
Contributor
|
Gonna pass to someone who knows more about ABIs. Sorry for not getting to this sooner. r? @bjorn3 |
bjorn3
reviewed
Sep 19, 2023
…on-ZST member This ensures that `MaybeUninit<T>` has the same ABI as `T` when passed through an `extern "C"` function. Fixes rust-lang#115481.
efd4e62 to
751ecde
Compare
Member
|
Could you add a codegen test for this to avoid regressing this in the future? |
Contributor
Author
AFAIK #115372 should cover this for RISC-V and other architectures. (This is actually how the bug was found in the first place.) |
Member
|
Thanks! @bors r+ |
Collaborator
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Sep 19, 2023
…llaumeGomez Rollup of 6 pull requests Successful merges: - rust-lang#113383 (style-guide: Add section on bugs, and resolving bugs) - rust-lang#115499 (rustc_target/riscv: Fix passing of transparent unions with only one non-ZST member) - rust-lang#115801 (Detect cycle errors hidden by opaques during monomorphization) - rust-lang#115947 (Custom code classes in docs warning) - rust-lang#115957 (fix mismatched symbols) - rust-lang#115958 (explain mysterious addition in float minimum/maximum) r? `@ghost` `@rustbot` modify labels: rollup
rust-timer
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Sep 19, 2023
Rollup merge of rust-lang#115499 - msizanoen1:riscv-fix-transparent-union-abi, r=bjorn3 rustc_target/riscv: Fix passing of transparent unions with only one non-ZST member This ensures that `MaybeUninit<T>` has the same ABI as `T` when passed through an `extern "C"` function. Fixes rust-lang#115481. r? `@RalfJung`
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This ensures that
MaybeUninit<T>has the same ABI asTwhen passed through anextern "C"function.Fixes #115481.
r? @RalfJung