Rollup merge of #142687 - cjgillot:less-hir_crate, r=oli-obk

Reduce uses of `hir_crate`.

I tried rebasing my old incremental-HIR branch. This is a by-product, which is required if we want to get rid of `hir_crate` entirely.

The second commit is a drive-by cleanup. It can be pulled into its own PR.

r? ````@oli-obk````
This commit is contained in:
Trevor Gross
2025-06-20 02:50:40 -04:00
committed by GitHub
16 changed files with 48 additions and 102 deletions

View File

@@ -311,9 +311,7 @@ fn default_body_is_unstable(
reason: reason_str,
});
let inject_span = item_did
.as_local()
.and_then(|id| tcx.crate_level_attribute_injection_span(tcx.local_def_id_to_hir_id(id)));
let inject_span = item_did.is_local().then(|| tcx.crate_level_attribute_injection_span());
rustc_session::parse::add_feature_diagnostics_for_issue(
&mut err,
&tcx.sess,