Invert dependency between rustc_errors and rustc_abi.

Currently, `rustc_errors` depends on `rustc_abi`, which depends on
`rustc_error_messages`. This is a bit odd.

`rustc_errors` depends on `rustc_abi` for a single reason: `rustc_abi`
defines a type `TargetDataLayoutErrors` and `rustc_errors` impls
`Diagnostic` for that type.

We can get a more natural relationship by inverting the dependency,
moving the `Diagnostic` trait upstream. Then `rustc_abi` defines
`TargetDataLayoutErrors` and also impls `Diagnostic` for it.
`rustc_errors` is already pretty far upstream in the crate graph, it
doesn't hurt to push it a little further because errors are a very
low-level concept.
This commit is contained in:
Nicholas Nethercote
2026-03-27 10:06:21 +11:00
parent a25435bcf7
commit b711f5689f
5 changed files with 53 additions and 55 deletions
+1 -1
View File
@@ -3504,6 +3504,7 @@ dependencies = [
"rand_xoshiro",
"rustc_data_structures",
"rustc_error_messages",
"rustc_errors",
"rustc_hashes",
"rustc_index",
"rustc_macros",
@@ -3908,7 +3909,6 @@ dependencies = [
"anstream",
"anstyle",
"derive_setters",
"rustc_abi",
"rustc_ast",
"rustc_data_structures",
"rustc_error_codes",