@@ -14,6 +14,7 @@ use rustc_infer::infer::outlives::env::OutlivesEnvironment;
1414use rustc_infer:: infer:: outlives:: obligations:: TypeOutlives ;
1515use rustc_infer:: infer:: region_constraints:: GenericKind ;
1616use rustc_infer:: infer:: { self , InferCtxt , TyCtxtInferExt } ;
17+ use rustc_middle:: ty:: query:: Providers ;
1718use rustc_middle:: ty:: subst:: { GenericArgKind , InternalSubsts , Subst } ;
1819use rustc_middle:: ty:: trait_def:: TraitSpecializationKind ;
1920use rustc_middle:: ty:: {
@@ -67,7 +68,7 @@ impl<'tcx> CheckWfFcxBuilder<'tcx> {
6768 }
6869}
6970
70- pub ( crate ) fn check_well_formed ( tcx : TyCtxt < ' _ > , def_id : LocalDefId ) {
71+ fn check_well_formed ( tcx : TyCtxt < ' _ > , def_id : LocalDefId ) {
7172 let node = tcx. hir ( ) . expect_owner ( def_id) ;
7273 match node {
7374 hir:: OwnerNode :: Crate ( _) => { }
@@ -1858,8 +1859,8 @@ fn check_false_global_bounds(fcx: &FnCtxt<'_, '_>, mut span: Span, id: hir::HirI
18581859 fcx. select_all_obligations_or_error ( ) ;
18591860}
18601861
1861- pub ( crate ) fn check_wf_new ( tcx : TyCtxt < ' _ > ) {
1862- let items = tcx. hir_crate_items ( ( ) ) ;
1862+ fn check_mod_type_wf ( tcx : TyCtxt < ' _ > , module : LocalDefId ) {
1863+ let items = tcx. hir_module_items ( module ) ;
18631864 par_for_each_in ( items. items ( ) , |item| tcx. ensure ( ) . check_well_formed ( item. def_id ) ) ;
18641865 par_for_each_in ( items. impl_items ( ) , |item| tcx. ensure ( ) . check_well_formed ( item. def_id ) ) ;
18651866 par_for_each_in ( items. trait_items ( ) , |item| tcx. ensure ( ) . check_well_formed ( item. def_id ) ) ;
@@ -1948,3 +1949,7 @@ fn error_392(
19481949 err. span_label ( span, "unused parameter" ) ;
19491950 err
19501951}
1952+
1953+ pub fn provide ( providers : & mut Providers ) {
1954+ * providers = Providers { check_mod_type_wf, check_well_formed, ..* providers } ;
1955+ }
0 commit comments