File tree 2 files changed +2
-8
lines changed
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> {
746
746
hir_id
747
747
}
748
748
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
-
755
749
/// Returns the `HirId` of `id`'s nearest module parent, or `id` itself if no
756
750
/// 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 {
758
752
for ( hir_id, node) in self . parent_iter ( hir_id) {
759
753
if let Node :: Item ( & Item { kind : ItemKind :: Mod ( _) , .. } ) = node {
760
754
return hir_id;
Original file line number Diff line number Diff line change @@ -55,7 +55,7 @@ impl<'tcx> TyCtxt<'tcx> {
55
55
pub fn provide ( providers : & mut Providers < ' _ > ) {
56
56
providers. parent_module_from_def_id = |tcx, id| {
57
57
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 ( ) ) )
59
59
} ;
60
60
providers. hir_crate = |tcx, _| tcx. hir_map . untracked_krate ( ) ;
61
61
map:: provide ( providers) ;
You can’t perform that action at this time.
0 commit comments