Skip to content

Commit 0bcd31a

Browse files
inline check::wfcheck::provide into check::provide
1 parent 840d49d commit 0bcd31a

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

compiler/rustc_hir_analysis/src/check/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,8 @@ pub(super) fn provide(providers: &mut Providers) {
109109
collect_return_position_impl_trait_in_trait_tys,
110110
compare_impl_item: compare_impl_item::compare_impl_item,
111111
check_coroutine_obligations: check::check_coroutine_obligations,
112+
check_type_wf: wfcheck::check_type_wf,
113+
check_well_formed: wfcheck::check_well_formed,
112114
..*providers
113115
};
114116
}

compiler/rustc_hir_analysis/src/check/wfcheck.rs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ use rustc_infer::infer::{self, InferCtxt, SubregionOrigin, TyCtxtInferExt};
1515
use rustc_lint_defs::builtin::SUPERTRAIT_ITEM_SHADOWING_DEFINITION;
1616
use rustc_macros::LintDiagnostic;
1717
use rustc_middle::mir::interpret::ErrorHandled;
18-
use rustc_middle::query::Providers;
1918
use rustc_middle::traits::solve::NoSolution;
2019
use rustc_middle::ty::trait_def::TraitSpecializationKind;
2120
use rustc_middle::ty::{
@@ -189,7 +188,10 @@ where
189188
}
190189
}
191190

192-
fn check_well_formed(tcx: TyCtxt<'_>, def_id: LocalDefId) -> Result<(), ErrorGuaranteed> {
191+
pub(super) fn check_well_formed(
192+
tcx: TyCtxt<'_>,
193+
def_id: LocalDefId,
194+
) -> Result<(), ErrorGuaranteed> {
193195
let mut res = crate::check::check::check_item_type(tcx, def_id);
194196

195197
for param in &tcx.generics_of(def_id).own_params {
@@ -2249,7 +2251,7 @@ impl<'tcx> WfCheckingCtxt<'_, 'tcx> {
22492251
}
22502252
}
22512253

2252-
fn check_type_wf(tcx: TyCtxt<'_>, (): ()) -> Result<(), ErrorGuaranteed> {
2254+
pub(super) fn check_type_wf(tcx: TyCtxt<'_>, (): ()) -> Result<(), ErrorGuaranteed> {
22532255
let items = tcx.hir_crate_items(());
22542256
let res = items
22552257
.par_items(|item| tcx.ensure_ok().check_well_formed(item.owner_id.def_id))
@@ -2397,7 +2399,3 @@ struct RedundantLifetimeArgsLint<'tcx> {
23972399
// The lifetime we can replace the victim with.
23982400
candidate: ty::Region<'tcx>,
23992401
}
2400-
2401-
pub fn provide(providers: &mut Providers) {
2402-
*providers = Providers { check_type_wf, check_well_formed, ..*providers };
2403-
}

0 commit comments

Comments
 (0)