File tree Expand file tree Collapse file tree 1 file changed +1
-10
lines changed
compiler/rustc_middle/src/hir/map Expand file tree Collapse file tree 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> {
3030 node : Node < ' hir > ,
3131}
3232
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-
4233fn fn_decl < ' hir > ( node : Node < ' hir > ) -> Option < & ' hir FnDecl < ' hir > > {
4334 match node {
4435 Node :: Item ( Item { kind : ItemKind :: Fn ( sig, _, _) , .. } )
@@ -529,7 +520,7 @@ impl<'hir> Map<'hir> {
529520 /// from a node to the root of the HIR (unless you get back the same ID here,
530521 /// which can happen if the ID is not in the map itself or is just weird).
531522 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
533524 }
534525
535526 /// 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