mirror of
https://github.com/rust-lang/rust.git
synced 2025-10-03 10:47:16 +00:00

Shorten some dependency chains in the compiler (I recommend reviewing this commit by commit.) One of the long dependency chains in the compiler is: - Many things depend on `rustc_errors`. - `rustc_errors` depended on many things prior to this PR, including `rustc_target`, `rustc_type_ir`, `rustc_hir`, and `rustc_lint_defs`. - `rustc_lint_defs` depended on `rustc_hir` prior to this PR. - `rustc_hir` depends on `rustc_target`. - `rustc_target` is large and takes a while. This PR breaks that chain, through a few steps: - The `IntoDiagArgs` trait, from `rustc_errors`, moves earlier in the dependency chain. This allows `rustc_errors` to stop depending on a pile of crates just to implement `IntoDiagArgs` for their types. - Split `rustc_hir_id` out of `rustc_hir`, so crates that just need `HirId` and similar don't depend on all of `rust_hir` (and thus `rustc_target`). - Make `rustc_lint_defs` stop depending on `rustc_hir`.
rustc_target
contains some very low-level details that are
specific to different compilation targets and so forth.
For more information about how rustc works, see the rustc dev guide.