os-rust/compiler/rustc_target/src
Jubilee 6da4221d96
Rollup merge of #132385 - workingjubilee:move-abi-to-rustc-abi, r=jieyouxu,compiler-errors
compiler: Move `rustc_target::spec::abi::Abi` to `rustc_abi::ExternAbi`

Lift `enum Abi` from its rather odd place in the middle of rustc_target, and make it available again from rustc_abi. You know, the crate where you would expect the enum that describes all the ABIs to be? The platform-neutral ones, at least. This will help further refactoring of how we handle ABIs in the near future[^0].

Rename `Abi` to `ExternAbi` because quite a lot of the compiler overloads the concept of "ABI" enough that the existing name is imprecise and it is often renamed _anyway_. Often this was to avoid conflicts with the *other* type formerly known as `Abi` (now named BackendRepr[^1]), but sometimes it is just for clarity, and this name seems more self-explanatory. It does get reexported, though, using its old name, to reduce the odds of merge-conflicting over the entire tree.

All of `ExternAbi`'s friends come along for the ride, which costs adding some optional dependencies to the rustc_abi crate. However, all of this also allows simply moving three crates entirely off rustc_target:
- rustc_hir_pretty
- rustc_lint_defs
- rustc_mir_build

This odd selection is mostly to demonstrate a secondary motivation: The majority of the front-end of the compiler should be as target-agnostic as possible, and it is easier to assure this if they simply don't depend on the crate that describes targets. Note that I didn't migrate crates that don't benefit from it in this way yet, and I didn't survey every last crate.

[^0]: This is being undertaken as part of https://github.com/rust-lang/rust/issues/119183
[^1]: https://github.com/rust-lang/rust/pull/132246
2024-10-31 17:50:42 -07:00
..
asm Rollup merge of #131667 - taiki-e:aarch64-inline-asm-reg-emit, r=Amanieu 2024-10-14 17:06:38 +02:00
callconv compiler: rustc_abi::Abi => BackendRepr 2024-10-29 14:56:00 -07:00
spec Rollup merge of #132385 - workingjubilee:move-abi-to-rustc-abi, r=jieyouxu,compiler-errors 2024-10-31 17:50:42 -07:00
json.rs compiler: Move impl of ToJson for abi::Endian 2024-10-11 17:41:52 -07:00
lib.rs compiler: Wire {TyAnd,}Layout into rustc_abi 2024-10-11 17:41:52 -07:00
target_features.rs Auto merge of #131900 - mrkajetanp:target-feature-pauth-lr, r=Amanieu 2024-10-27 00:09:49 +00:00
tests.rs Use serde_json for target spec json 2022-06-03 16:46:19 +00:00