about summary refs log tree commit diff
path: root/compiler/rustc_middle/src/query/mod.rs
diff options
context:
space:
mode:
authorJubilee <workingjubilee@gmail.com>2024-11-03 15:25:00 -0800
committerGitHub <noreply@github.com>2024-11-03 15:25:00 -0800
commit72df7780dd966be9970a68e22d413f11f4c3ef7a (patch)
tree96101e7e501c3e7ba0f1b17164a9cff3c9e97508 /compiler/rustc_middle/src/query/mod.rs
parent1505997c64c2aa4a3736a4e480ef69dbfaa810da (diff)
parentfa2047370b4ed15d7ab3cbb54ad1c16f595322df (diff)
downloadrust-72df7780dd966be9970a68e22d413f11f4c3ef7a.tar.gz
rust-72df7780dd966be9970a68e22d413f11f4c3ef7a.zip
Rollup merge of #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
Diffstat (limited to 'compiler/rustc_middle/src/query/mod.rs')
-rw-r--r--compiler/rustc_middle/src/query/mod.rs7
1 files changed, 3 insertions, 4 deletions
diff --git a/compiler/rustc_middle/src/query/mod.rs b/compiler/rustc_middle/src/query/mod.rs
index 088b5d4ec96..41d0b47388c 100644
--- a/compiler/rustc_middle/src/query/mod.rs
+++ b/compiler/rustc_middle/src/query/mod.rs
@@ -42,9 +42,8 @@ use rustc_session::lint::LintExpectationId;
 use rustc_span::def_id::LOCAL_CRATE;
 use rustc_span::symbol::Symbol;
 use rustc_span::{DUMMY_SP, Span};
-use rustc_target::abi;
 use rustc_target::spec::PanicStrategy;
-use {rustc_ast as ast, rustc_attr as attr, rustc_hir as hir};
+use {rustc_abi as abi, rustc_ast as ast, rustc_attr as attr, rustc_hir as hir};
 
 use crate::infer::canonical::{self, Canonical};
 use crate::lint::LintExpectation;
@@ -1465,7 +1464,7 @@ rustc_queries! {
     /// instead, where the instance is an `InstanceKind::Virtual`.
     query fn_abi_of_fn_ptr(
         key: ty::ParamEnvAnd<'tcx, (ty::PolyFnSig<'tcx>, &'tcx ty::List<Ty<'tcx>>)>
-    ) -> Result<&'tcx abi::call::FnAbi<'tcx, Ty<'tcx>>, &'tcx ty::layout::FnAbiError<'tcx>> {
+    ) -> Result<&'tcx rustc_target::callconv::FnAbi<'tcx, Ty<'tcx>>, &'tcx ty::layout::FnAbiError<'tcx>> {
         desc { "computing call ABI of `{}` function pointers", key.value.0 }
     }
 
@@ -1476,7 +1475,7 @@ rustc_queries! {
     /// to an `InstanceKind::Virtual` instance (of `<dyn Trait as Trait>::fn`).
     query fn_abi_of_instance(
         key: ty::ParamEnvAnd<'tcx, (ty::Instance<'tcx>, &'tcx ty::List<Ty<'tcx>>)>
-    ) -> Result<&'tcx abi::call::FnAbi<'tcx, Ty<'tcx>>, &'tcx ty::layout::FnAbiError<'tcx>> {
+    ) -> Result<&'tcx rustc_target::callconv::FnAbi<'tcx, Ty<'tcx>>, &'tcx ty::layout::FnAbiError<'tcx>> {
         desc { "computing call ABI of `{}`", key.value.0 }
     }