@@ -8,7 +8,6 @@ use crate::arena::Arena;
88use crate :: dep_graph:: { DepGraph , DepKindStruct } ;
99use crate :: infer:: canonical:: CanonicalVarInfo ;
1010use crate :: lint:: struct_lint_level;
11- use crate :: metadata:: ModChild ;
1211use crate :: middle:: codegen_fn_attrs:: CodegenFnAttrs ;
1312use crate :: middle:: resolve_bound_vars;
1413use crate :: middle:: stability;
@@ -2114,19 +2113,6 @@ impl<'tcx> TyCtxt<'tcx> {
21142113 self . opt_rpitit_info ( def_id) . is_some ( )
21152114 }
21162115
2117- /// Named module children from all kinds of items, including imports.
2118- /// In addition to regular items this list also includes struct and variant constructors, and
2119- /// items inside `extern {}` blocks because all of them introduce names into parent module.
2120- ///
2121- /// Module here is understood in name resolution sense - it can be a `mod` item,
2122- /// or a crate root, or an enum, or a trait.
2123- ///
2124- /// This is not a query, making it a query causes perf regressions
2125- /// (probably due to hashing spans in `ModChild`ren).
2126- pub fn module_children_local ( self , def_id : LocalDefId ) -> & ' tcx [ ModChild ] {
2127- self . resolutions ( ( ) ) . module_children . get ( & def_id) . map_or ( & [ ] , |v| & v[ ..] )
2128- }
2129-
21302116 pub fn metadata_dep_node ( self ) -> crate :: dep_graph:: DepNode {
21312117 crate :: dep_graph:: make_metadata ( self )
21322118 }
@@ -2148,6 +2134,8 @@ pub struct DeducedParamAttrs {
21482134}
21492135
21502136pub fn provide ( providers : & mut Providers ) {
2137+ providers. module_children_local =
2138+ |tcx, def_id| tcx. resolutions ( ( ) ) . module_children . get ( & def_id) . map_or ( & [ ] , |v| & v[ ..] ) ;
21512139 providers. maybe_unused_trait_imports =
21522140 |tcx, ( ) | & tcx. resolutions ( ( ) ) . maybe_unused_trait_imports ;
21532141 providers. names_imported_by_glob_use = |tcx, id| {
0 commit comments