@@ -14,6 +14,7 @@ use rustc_infer::infer::outlives::env::OutlivesEnvironment;
14
14
use rustc_infer:: infer:: outlives:: obligations:: TypeOutlives ;
15
15
use rustc_infer:: infer:: region_constraints:: GenericKind ;
16
16
use rustc_infer:: infer:: { self , InferCtxt , TyCtxtInferExt } ;
17
+ use rustc_middle:: ty:: query:: Providers ;
17
18
use rustc_middle:: ty:: subst:: { GenericArgKind , InternalSubsts , Subst } ;
18
19
use rustc_middle:: ty:: trait_def:: TraitSpecializationKind ;
19
20
use rustc_middle:: ty:: {
@@ -67,7 +68,7 @@ impl<'tcx> CheckWfFcxBuilder<'tcx> {
67
68
}
68
69
}
69
70
70
- pub ( crate ) fn check_well_formed ( tcx : TyCtxt < ' _ > , def_id : LocalDefId ) {
71
+ fn check_well_formed ( tcx : TyCtxt < ' _ > , def_id : LocalDefId ) {
71
72
let node = tcx. hir ( ) . expect_owner ( def_id) ;
72
73
match node {
73
74
hir:: OwnerNode :: Crate ( _) => { }
@@ -1858,8 +1859,8 @@ fn check_false_global_bounds(fcx: &FnCtxt<'_, '_>, mut span: Span, id: hir::HirI
1858
1859
fcx. select_all_obligations_or_error ( ) ;
1859
1860
}
1860
1861
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 ) ;
1863
1864
par_for_each_in ( items. items ( ) , |item| tcx. ensure ( ) . check_well_formed ( item. def_id ) ) ;
1864
1865
par_for_each_in ( items. impl_items ( ) , |item| tcx. ensure ( ) . check_well_formed ( item. def_id ) ) ;
1865
1866
par_for_each_in ( items. trait_items ( ) , |item| tcx. ensure ( ) . check_well_formed ( item. def_id ) ) ;
@@ -1948,3 +1949,7 @@ fn error_392(
1948
1949
err. span_label ( span, "unused parameter" ) ;
1949
1950
err
1950
1951
}
1952
+
1953
+ pub fn provide ( providers : & mut Providers ) {
1954
+ * providers = Providers { check_mod_type_wf, check_well_formed, ..* providers } ;
1955
+ }
0 commit comments