Skip to content

Commit d7e6164

Browse files
committed
simplify thir visitor
1 parent 44bcf8d commit d7e6164

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

compiler/rustc_middle/src/thir/visit.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -83,13 +83,7 @@ pub fn walk_expr<'thir, 'tcx: 'thir, V: Visitor<'thir, 'tcx>>(
8383
visitor.visit_pat(pat);
8484
}
8585
Loop { body } => visitor.visit_expr(&visitor.thir()[body]),
86-
LoopMatch { state, ref arms, .. } => {
87-
visitor.visit_expr(&visitor.thir()[state]);
88-
for &arm in &**arms {
89-
visitor.visit_arm(&visitor.thir()[arm]);
90-
}
91-
}
92-
Match { scrutinee, ref arms, .. } => {
86+
LoopMatch { state: scrutinee, ref arms, .. } | Match { scrutinee, ref arms, .. } => {
9387
visitor.visit_expr(&visitor.thir()[scrutinee]);
9488
for &arm in &**arms {
9589
visitor.visit_arm(&visitor.thir()[arm]);

0 commit comments

Comments
 (0)