@@ -63,7 +63,6 @@ use crate::arena::Arena;
6363use crate :: dep_graph:: { DepGraph , DepKindStruct } ;
6464use crate :: infer:: canonical:: { CanonicalParamEnvCache , CanonicalVarKind , CanonicalVarKinds } ;
6565use crate :: lint:: lint_level;
66- use crate :: metadata:: ModChild ;
6766use crate :: middle:: codegen_fn_attrs:: { CodegenFnAttrs , TargetFeature } ;
6867use crate :: middle:: { resolve_bound_vars, stability} ;
6968use crate :: mir:: interpret:: { self , Allocation , ConstAllocation } ;
@@ -3373,19 +3372,6 @@ impl<'tcx> TyCtxt<'tcx> {
33733372 self . opt_rpitit_info ( def_id) . is_some ( )
33743373 }
33753374
3376- /// Named module children from all kinds of items, including imports.
3377- /// In addition to regular items this list also includes struct and variant constructors, and
3378- /// items inside `extern {}` blocks because all of them introduce names into parent module.
3379- ///
3380- /// Module here is understood in name resolution sense - it can be a `mod` item,
3381- /// or a crate root, or an enum, or a trait.
3382- ///
3383- /// This is not a query, making it a query causes perf regressions
3384- /// (probably due to hashing spans in `ModChild`ren).
3385- pub fn module_children_local ( self , def_id : LocalDefId ) -> & ' tcx [ ModChild ] {
3386- self . resolutions ( ( ) ) . module_children . get ( & def_id) . map_or ( & [ ] , |v| & v[ ..] )
3387- }
3388-
33893375 pub fn resolver_for_lowering ( self ) -> & ' tcx Steal < ( ty:: ResolverAstLowering , Arc < ast:: Crate > ) > {
33903376 self . resolver_for_lowering_raw ( ( ) ) . 0
33913377 }
@@ -3437,6 +3423,8 @@ pub struct DeducedParamAttrs {
34373423}
34383424
34393425pub fn provide ( providers : & mut Providers ) {
3426+ providers. module_children_local =
3427+ |tcx, def_id| tcx. resolutions ( ( ) ) . module_children . get ( & def_id) . map_or ( & [ ] , |v| & v[ ..] ) ;
34403428 providers. maybe_unused_trait_imports =
34413429 |tcx, ( ) | & tcx. resolutions ( ( ) ) . maybe_unused_trait_imports ;
34423430 providers. names_imported_by_glob_use = |tcx, id| {
0 commit comments