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> {
74
74
if self . current_id == CRATE_HIR_ID {
75
75
return None ;
76
76
}
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 ) ;
80
77
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 ) ;
85
80
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 ;
88
84
}
85
+
86
+ self . current_id = parent_id;
87
+ return Some ( parent_id) ;
89
88
}
90
89
}
91
90
You can’t perform that action at this time.
0 commit comments