File tree 1 file changed +1
-10
lines changed
compiler/rustc_middle/src/hir/map 1 file changed +1
-10
lines changed Original file line number Diff line number Diff line change @@ -30,15 +30,6 @@ pub struct Entry<'hir> {
30
30
node : Node < ' hir > ,
31
31
}
32
32
33
- impl < ' hir > Entry < ' hir > {
34
- fn parent_node ( self ) -> Option < HirId > {
35
- match self . node {
36
- Node :: Crate ( _) => None ,
37
- _ => Some ( self . parent ) ,
38
- }
39
- }
40
- }
41
-
42
33
fn fn_decl < ' hir > ( node : Node < ' hir > ) -> Option < & ' hir FnDecl < ' hir > > {
43
34
match node {
44
35
Node :: Item ( Item { kind : ItemKind :: Fn ( sig, _, _) , .. } )
@@ -529,7 +520,7 @@ impl<'hir> Map<'hir> {
529
520
/// from a node to the root of the HIR (unless you get back the same ID here,
530
521
/// which can happen if the ID is not in the map itself or is just weird).
531
522
pub fn get_parent_node ( & self , hir_id : HirId ) -> HirId {
532
- self . get_entry ( hir_id) . parent_node ( ) . unwrap_or ( hir_id )
523
+ self . get_entry ( hir_id) . parent
533
524
}
534
525
535
526
/// Returns an iterator for the nodes in the ancestor tree of the `current_id`
You can’t perform that action at this time.
0 commit comments