File tree Expand file tree Collapse file tree 1 file changed +8
-9
lines changed
compiler/rustc_middle/src/hir/map Expand file tree Collapse file tree 1 file changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -74,18 +74,17 @@ impl<'hir> Iterator for ParentHirIterator<'hir> {
7474 if self . current_id == CRATE_HIR_ID {
7575 return None ;
7676 }
77- loop {
78- // There are nodes that do not have entries, so we need to skip them.
79- let parent_id = self . map . parent_id ( self . current_id ) ;
8077
81- if parent_id == self . current_id {
82- self . current_id = CRATE_HIR_ID ;
83- return None ;
84- }
78+ // There are nodes that do not have entries, so we need to skip them.
79+ let parent_id = self . map . parent_id ( self . current_id ) ;
8580
86- self . current_id = parent_id;
87- return Some ( parent_id) ;
81+ if parent_id == self . current_id {
82+ self . current_id = CRATE_HIR_ID ;
83+ return None ;
8884 }
85+
86+ self . current_id = parent_id;
87+ return Some ( parent_id) ;
8988 }
9089}
9190
You can’t perform that action at this time.
0 commit comments