Rollup merge of #136603 - workingjubilee:move-abi-versioning-into-ast, r=compiler-errors

compiler: gate `extern "{abi}"` in ast_lowering

I don't believe low-level crates like `rustc_abi` should have to know or care about higher-level concerns like whether the ABI string is stable for users. These implementation details can be made less open to public inspection. This way the code that governs stability is near the code that enforces stability, and compiled together.

It also abstracts away certain error messages instead of constantly repeating them.

A few error messages are simply deleted outright, instead of made uniform, because they are either too dated to be useful or redundant with other diagnostic improvements we could make. These can be pursued in followups: my first concern was making sure there wasn't unnecessary diagnostics-related code in `rustc_abi`, which is not well-positioned to understand what kind of errors are going to be generated based on how it is used.

r? ``@ghost``
This commit is contained in:
Matthias Krüger
2025-02-11 02:53:44 +01:00
committed by GitHub
62 changed files with 395 additions and 420 deletions

View File

@@ -57,13 +57,6 @@ use crate::spec::crt_objects::CrtObjects;
pub mod crt_objects;
pub mod abi {
pub use rustc_abi::{
AbiDisabled, AbiUnsupported, ExternAbi as Abi, all_names, enabled_names, is_enabled,
is_stable, lookup,
};
}
mod base;
mod json;