rustc_lint_defs: Eliminate the dependency on rustc_hir for Namespace

`rustc_lint_defs` uses `rustc_hir` solely for the `Namespace` type,
which it only needs the static description from. Use the static
description directly, to eliminate the dependency on `rustc_hir`.

This reduces a long dependency chain:
- Many things depend on `rustc_errors`
- `rustc_errors` depends on `rustc_lint_defs`
- `rustc_lint_defs` depended on `rustc_hir` prior to this commit
- `rustc_hir` depends on `rustc_target`
This commit is contained in:
Josh Triplett
2025-08-14 01:56:14 -07:00
parent 6cb9dd563c
commit f0c8f7062b
7 changed files with 10 additions and 12 deletions

View File

@@ -8,7 +8,6 @@ use rustc_errors::{
EmissionGuarantee, LintDiagnostic, MultiSpan, Subdiagnostic, SuggestionStyle,
};
use rustc_hir as hir;
use rustc_hir::def::Namespace;
use rustc_hir::def_id::DefId;
use rustc_hir::intravisit::VisitorExt;
use rustc_macros::{LintDiagnostic, Subdiagnostic};
@@ -2769,7 +2768,7 @@ pub(crate) struct AbsPathWithModuleSugg {
pub(crate) struct ProcMacroDeriveResolutionFallback {
#[label]
pub span: Span,
pub ns: Namespace,
pub ns_descr: &'static str,
pub ident: Ident,
}