diff options
| author | Jubilee Young <workingjubilee@gmail.com> | 2025-07-03 10:52:56 -0700 |
|---|---|---|
| committer | Jubilee Young <workingjubilee@gmail.com> | 2025-07-03 13:48:32 -0700 |
| commit | f5fbb2c0a5f2026453a3fa4c46afaaa2c0092e1f (patch) | |
| tree | 084191836fa7a10345a495523cacd25865dc40fc /compiler/rustc_hir_analysis/src/check/wfcheck.rs | |
| parent | 6677875279b560442a07a08d5119b4cd6b3c5593 (diff) | |
| download | rust-f5fbb2c0a5f2026453a3fa4c46afaaa2c0092e1f.tar.gz rust-f5fbb2c0a5f2026453a3fa4c46afaaa2c0092e1f.zip | |
compiler: inline 1-2 query provide fn in hir_analysis and hir_typeck
Many small indirections with 1-2 items actively hinders understanding. Inlines various tiny submodule provides into - hir_analysis::provide - hir_analysis::check::provide - hir_typeck::provide
Diffstat (limited to 'compiler/rustc_hir_analysis/src/check/wfcheck.rs')
| -rw-r--r-- | compiler/rustc_hir_analysis/src/check/wfcheck.rs | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/compiler/rustc_hir_analysis/src/check/wfcheck.rs b/compiler/rustc_hir_analysis/src/check/wfcheck.rs index ed8d25e9915..4934136bc7a 100644 --- a/compiler/rustc_hir_analysis/src/check/wfcheck.rs +++ b/compiler/rustc_hir_analysis/src/check/wfcheck.rs @@ -15,7 +15,6 @@ use rustc_infer::infer::{self, InferCtxt, SubregionOrigin, TyCtxtInferExt}; use rustc_lint_defs::builtin::SUPERTRAIT_ITEM_SHADOWING_DEFINITION; use rustc_macros::LintDiagnostic; use rustc_middle::mir::interpret::ErrorHandled; -use rustc_middle::query::Providers; use rustc_middle::traits::solve::NoSolution; use rustc_middle::ty::trait_def::TraitSpecializationKind; use rustc_middle::ty::{ @@ -189,7 +188,10 @@ where } } -fn check_well_formed(tcx: TyCtxt<'_>, def_id: LocalDefId) -> Result<(), ErrorGuaranteed> { +pub(super) fn check_well_formed( + tcx: TyCtxt<'_>, + def_id: LocalDefId, +) -> Result<(), ErrorGuaranteed> { let mut res = crate::check::check::check_item_type(tcx, def_id); for param in &tcx.generics_of(def_id).own_params { @@ -2249,7 +2251,7 @@ impl<'tcx> WfCheckingCtxt<'_, 'tcx> { } } -fn check_type_wf(tcx: TyCtxt<'_>, (): ()) -> Result<(), ErrorGuaranteed> { +pub(super) fn check_type_wf(tcx: TyCtxt<'_>, (): ()) -> Result<(), ErrorGuaranteed> { let items = tcx.hir_crate_items(()); let res = items .par_items(|item| tcx.ensure_ok().check_well_formed(item.owner_id.def_id)) @@ -2397,7 +2399,3 @@ struct RedundantLifetimeArgsLint<'tcx> { // The lifetime we can replace the victim with. candidate: ty::Region<'tcx>, } - -pub fn provide(providers: &mut Providers) { - *providers = Providers { check_type_wf, check_well_formed, ..*providers }; -} |
