File tree Expand file tree Collapse file tree 2 files changed +2
-8
lines changed Expand file tree Collapse file tree 2 files changed +2
-8
lines changed Original file line number Diff line number Diff line change @@ -746,15 +746,9 @@ impl<'hir> Map<'hir> {
746746 hir_id
747747 }
748748
749- /// Returns the `DefId` of `id`'s nearest module parent, or `id` itself if no
750- /// module parent is in this map.
751- pub fn get_module_parent ( & self , id : HirId ) -> DefId {
752- self . local_def_id ( self . get_module_parent_node ( id) )
753- }
754-
755749 /// Returns the `HirId` of `id`'s nearest module parent, or `id` itself if no
756750 /// module parent is in this map.
757- pub fn get_module_parent_node ( & self , hir_id : HirId ) -> HirId {
751+ pub ( super ) fn get_module_parent_node ( & self , hir_id : HirId ) -> HirId {
758752 for ( hir_id, node) in self . parent_iter ( hir_id) {
759753 if let Node :: Item ( & Item { kind : ItemKind :: Mod ( _) , .. } ) = node {
760754 return hir_id;
Original file line number Diff line number Diff line change @@ -55,7 +55,7 @@ impl<'tcx> TyCtxt<'tcx> {
5555pub fn provide ( providers : & mut Providers < ' _ > ) {
5656 providers. parent_module_from_def_id = |tcx, id| {
5757 let hir = tcx. hir ( ) ;
58- hir. get_module_parent ( hir. as_local_hir_id ( id) . unwrap ( ) )
58+ hir. local_def_id ( hir. get_module_parent_node ( hir . as_local_hir_id ( id) . unwrap ( ) ) )
5959 } ;
6060 providers. hir_crate = |tcx, _| tcx. hir_map . untracked_krate ( ) ;
6161 map:: provide ( providers) ;
You can’t perform that action at this time.
0 commit comments