Split rustc_hir_id out of rustc_hir

Some crates depend on `rustc_hir` but only want `HirId` and similar id
types. `rustc_hir` is a heavy dependency, since it pulls in
`rustc_target`. Split these types out into their own crate
`rustc_hir_id`.

This allows `rustc_errors` to drop its direct dependency on `rustc_hir`.

(`rustc_errors` still depends on `rustc_hir` indirectly through
`rustc_lint_defs`; a subsequent commit will fix that.)
This commit is contained in:
Josh Triplett 2025-08-14 01:33:59 -07:00
parent b65fab6299
commit f3c8b7ad40
10 changed files with 61 additions and 35 deletions

View file

@ -3803,7 +3803,7 @@ dependencies = [
"rustc_error_messages",
"rustc_fluent_macro",
"rustc_hashes",
"rustc_hir",
"rustc_hir_id",
"rustc_index",
"rustc_lexer",
"rustc_lint_defs",
@ -3899,6 +3899,7 @@ dependencies = [
"rustc_data_structures",
"rustc_error_messages",
"rustc_hashes",
"rustc_hir_id",
"rustc_index",
"rustc_macros",
"rustc_serialize",
@ -3936,6 +3937,17 @@ dependencies = [
"tracing",
]
[[package]]
name = "rustc_hir_id"
version = "0.0.0"
dependencies = [
"rustc_data_structures",
"rustc_index",
"rustc_macros",
"rustc_serialize",
"rustc_span",
]
[[package]]
name = "rustc_hir_pretty"
version = "0.0.0"
@ -4128,6 +4140,7 @@ dependencies = [
"rustc_data_structures",
"rustc_error_messages",
"rustc_hir",
"rustc_hir_id",
"rustc_macros",
"rustc_serialize",
"rustc_span",