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

compiler: Directly use rustc_abi almost everywhere #132574

Merged
merged 11 commits into from
Nov 4, 2024

Conversation

workingjubilee
Copy link
Member

@workingjubilee workingjubilee commented Nov 3, 2024

Use rustc_abi instead of rustc_target where applicable. This is mostly described by the following substitutions:

match path_substring {
    rustc_target::spec::abi::Abi => rustc_abi::ExternAbi,
    rustc_target::abi::call => rustc_target::callconv,
    rustc_target::abi => rustc_abi,
}

A number of spot-fixes make that not quite the whole story.

The main exception is in 236fe33 where I get a lot more persnickety about how things are imported, especially in rustc_middle::ty::layout, not just from where. This includes putting an end to a reexport of rustc_middle::ty::ReprOptions, for the same reason that the rest of this change is happening: reexports mostly confound things.

This notably omits rustc_passes and the ast crates, as I'm still examining a question I have about how they do stability checking of extern "Abi" strings and if I can simplify their logic. The rustc_abi and rustc_target crates also go untouched because they will be entangled in that cleanup.

r? compiler-errors

@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 Nov 3, 2024
@rustbot
Copy link
Collaborator

rustbot commented Nov 3, 2024

Some changes occurred to MIR optimizations

cc @rust-lang/wg-mir-opt

Some changes occurred in rustc_ty_utils::consts.rs

cc @BoxyUwU

These commits modify the Cargo.lock file. Unintentional changes to Cargo.lock can be introduced when switching branches and rebasing PRs.

If this was unintentional then you should revert the changes before this PR is merged.
Otherwise, you can ignore this comment.

This PR changes MIR

cc @oli-obk, @RalfJung, @JakobDegen, @davidtwco, @celinval, @vakaras

Some changes occurred to the CTFE / Miri interpreter

cc @rust-lang/miri

HIR ty lowering was modified

cc @fmease

Some changes occurred to the CTFE / Miri interpreter

cc @rust-lang/miri

Some changes occurred in coverage instrumentation.

cc @Zalathar

Some changes occurred in exhaustiveness checking

cc @Nadrieril

@workingjubilee
Copy link
Member Author

...Good afternoon, T-compiler!

@rust-log-analyzer

This comment has been minimized.

@@ -166,13 +163,13 @@ impl Primitive {
#[inline]
fn to_int_ty<'tcx>(&self, tcx: TyCtxt<'tcx>) -> Ty<'tcx> {
match *self {
Int(i, signed) => i.to_ty(tcx, signed),
Primitive::Int(i, signed) => i.to_ty(tcx, signed),
Copy link
Member

Choose a reason for hiding this comment

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

were these glob imported previously? are they no longer?

Copy link
Member Author

@workingjubilee workingjubilee Nov 3, 2024

Choose a reason for hiding this comment

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

Yes. Wait, no, lol.

Copy link
Member

@compiler-errors compiler-errors left a comment

Choose a reason for hiding this comment

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

r=me when ci is green

@workingjubilee
Copy link
Member Author

@bors r=compiler-errors

@bors
Copy link
Contributor

bors commented Nov 3, 2024

📌 Commit fa20473 has been approved by compiler-errors

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-review Status: Awaiting review from the assignee but also interested parties. labels Nov 3, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 4, 2024
…kingjubilee

Rollup of 6 pull requests

Successful merges:

 - rust-lang#126136 (Call the target libdir target libdir)
 - rust-lang#132516 (Add bad-reg inline assembly ui test for RISC-V and s390x)
 - rust-lang#132521 (replace manual time convertions with std ones, comptime time format parsing)
 - rust-lang#132560 (Remove outdated tidy license fixmes)
 - rust-lang#132563 (Modify `NonZero` documentation to reference the underlying integer type)
 - rust-lang#132574 (compiler: Directly use rustc_abi almost everywhere)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 72df778 into rust-lang:master Nov 4, 2024
6 checks passed
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Nov 4, 2024
Rollup merge of rust-lang#132574 - workingjubilee:abi-in-compiler, r=compiler-errors

compiler: Directly use rustc_abi almost everywhere

Use rustc_abi instead of rustc_target where applicable. This is mostly described by the following substitutions:
```rust
match path_substring {
    rustc_target::spec::abi::Abi => rustc_abi::ExternAbi,
    rustc_target::abi::call => rustc_target::callconv,
    rustc_target::abi => rustc_abi,
}
```

A number of spot-fixes make that not quite the whole story.

The main exception is in 33edc68 where I get a lot more persnickety about how things are imported, especially in `rustc_middle::ty::layout`, not just from where. This includes putting an end to a reexport of `rustc_middle::ty::ReprOptions`, for the same reason that the rest of this change is happening: reexports mostly confound things.

This notably omits rustc_passes and the ast crates, as I'm still examining a question I have about how they do stability checking of `extern "Abi"` strings and if I can simplify their logic. The rustc_abi and rustc_target crates also go untouched because they will be entangled in that cleanup.

r? compiler-errors
@rustbot rustbot added this to the 1.84.0 milestone Nov 4, 2024
@workingjubilee workingjubilee deleted the abi-in-compiler branch November 4, 2024 04:03
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.

6 participants