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

ABI compat check: detect unadjusted ABI mismatches #129649

Merged
merged 1 commit into from
Aug 27, 2024

Conversation

RalfJung
Copy link
Member

No description provided.

@rustbot
Copy link
Collaborator

rustbot commented Aug 27, 2024

r? @petrochenkov

rustbot has assigned @petrochenkov.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot
Copy link
Collaborator

rustbot commented Aug 27, 2024

These commits modify compiler targets.
(See the Target Tier Policy.)

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Aug 27, 2024
// That elevates any type difference to an ABI difference since we just use the
// full Rust type as the LLVM argument/return type.
if matches!(self.mode, PassMode::Direct(..))
&& matches!(self.layout.abi, Abi::Aggregate { .. })
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these PassMode::Direct concerns irrelevant for non-aggregates?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes -- for non-aggregates, codegen uses the layout.abi information to compute how the argument should be passed, which has already been checked to be sufficiently compatible. It is only with Aggregate that the underlying Rust type "leaks through".

@petrochenkov
Copy link
Contributor

This looks reasonable to me, but I may be missing some of the necessary context.
r=me, unless you want someone else to review.
@rustbot author

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 27, 2024
@RalfJung
Copy link
Member Author

@bors r=petrochenkov rollup

@bors
Copy link
Contributor

bors commented Aug 27, 2024

📌 Commit ab7b03e has been approved by petrochenkov

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Aug 27, 2024
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Aug 27, 2024
…r=petrochenkov

ABI compat check: detect unadjusted ABI mismatches
bors added a commit to rust-lang-ci/rust that referenced this pull request Aug 27, 2024
…iaskrgr

Rollup of 8 pull requests

Successful merges:

 - rust-lang#129401 (Partially stabilize `feature(new_uninit)`)
 - rust-lang#129581 (exit: explain our expectations for the exit handlers registered in a Rust program)
 - rust-lang#129634 (Fix tidy to allow `edition = "2024"` in `Cargo.toml`)
 - rust-lang#129635 (Use unsafe extern blocks throughout the compiler)
 - rust-lang#129645 (Fix typos in floating-point primitive type docs)
 - rust-lang#129648 (More `unreachable_pub`)
 - rust-lang#129649 (ABI compat check: detect unadjusted ABI mismatches)
 - rust-lang#129652 (fix Pointer to reference conversion docs)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit to rust-lang-ci/rust that referenced this pull request Aug 27, 2024
…iaskrgr

Rollup of 8 pull requests

Successful merges:

 - rust-lang#129507 (make it possible to enable const_precise_live_drops per-function)
 - rust-lang#129581 (exit: explain our expectations for the exit handlers registered in a Rust program)
 - rust-lang#129634 (Fix tidy to allow `edition = "2024"` in `Cargo.toml`)
 - rust-lang#129635 (Use unsafe extern blocks throughout the compiler)
 - rust-lang#129645 (Fix typos in floating-point primitive type docs)
 - rust-lang#129648 (More `unreachable_pub`)
 - rust-lang#129649 (ABI compat check: detect unadjusted ABI mismatches)
 - rust-lang#129652 (fix Pointer to reference conversion docs)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit to rust-lang-ci/rust that referenced this pull request Aug 27, 2024
…iaskrgr

Rollup of 8 pull requests

Successful merges:

 - rust-lang#129507 (make it possible to enable const_precise_live_drops per-function)
 - rust-lang#129581 (exit: explain our expectations for the exit handlers registered in a Rust program)
 - rust-lang#129634 (Fix tidy to allow `edition = "2024"` in `Cargo.toml`)
 - rust-lang#129635 (Use unsafe extern blocks throughout the compiler)
 - rust-lang#129645 (Fix typos in floating-point primitive type docs)
 - rust-lang#129648 (More `unreachable_pub`)
 - rust-lang#129649 (ABI compat check: detect unadjusted ABI mismatches)
 - rust-lang#129652 (fix Pointer to reference conversion docs)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 5e226dd into rust-lang:master Aug 27, 2024
6 checks passed
@rustbot rustbot added this to the 1.82.0 milestone Aug 27, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Aug 27, 2024
Rollup merge of rust-lang#129649 - RalfJung:unadjusted-abi-mismatch, r=petrochenkov

ABI compat check: detect unadjusted ABI mismatches
@RalfJung RalfJung deleted the unadjusted-abi-mismatch branch August 28, 2024 05:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants