diff options
| author | Trevor Gross <t.gross35@gmail.com> | 2025-06-20 02:50:40 -0400 | 
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-06-20 02:50:40 -0400 | 
| commit | dd41c06e27df4f1e80f236d4c4bd47606773468d (patch) | |
| tree | 730ea605dca9b22eeaaf8fc5871ea2fa25e4f48d /compiler/rustc_hir_analysis/src | |
| parent | 52758b7329d436979f8bd8a36d1ca4c476a663fd (diff) | |
| parent | ede48910fdb8956f4a23a3bb29ded754206a3ef2 (diff) | |
| download | rust-dd41c06e27df4f1e80f236d4c4bd47606773468d.tar.gz rust-dd41c06e27df4f1e80f236d4c4bd47606773468d.zip | |
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````
Diffstat (limited to 'compiler/rustc_hir_analysis/src')
| -rw-r--r-- | compiler/rustc_hir_analysis/src/check/mod.rs | 4 | ||||
| -rw-r--r-- | compiler/rustc_hir_analysis/src/check/wfcheck.rs | 2 | 
2 files changed, 2 insertions, 4 deletions
| diff --git a/compiler/rustc_hir_analysis/src/check/mod.rs b/compiler/rustc_hir_analysis/src/check/mod.rs index ca24d5a6424..bf2d4f662ef 100644 --- a/compiler/rustc_hir_analysis/src/check/mod.rs +++ b/compiler/rustc_hir_analysis/src/check/mod.rs @@ -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, diff --git a/compiler/rustc_hir_analysis/src/check/wfcheck.rs b/compiler/rustc_hir_analysis/src/check/wfcheck.rs index 20d0e87b7a7..13f95024e5a 100644 --- a/compiler/rustc_hir_analysis/src/check/wfcheck.rs +++ b/compiler/rustc_hir_analysis/src/check/wfcheck.rs @@ -1064,7 +1064,7 @@ fn check_param_wf(tcx: TyCtxt<'_>, param: &hir::GenericParam<'_>) -> Result<(), Ok(..) => Some(vec![(adt_const_params_feature_string, sym::adt_const_params)]), }; if let Some(features) = may_suggest_feature { - tcx.disabled_nightly_features(&mut diag, Some(param.hir_id), features); + tcx.disabled_nightly_features(&mut diag, features); } Err(diag.emit()) | 
