for arm in arms {
// Add an exit node for when we've visited all the
// patterns and the guard (if there is one) in the arm.
- let arm_exit = self.add_dummy_node(&[]);
+ let bindings_exit = self.add_dummy_node(&[]);
for pat in &arm.pats {
// Visit the pattern, coming from the discriminant exit
// Add an edge from the exit of this pattern to the
// exit of the arm
- self.add_contained_edge(pat_exit, arm_exit);
+ self.add_contained_edge(pat_exit, bindings_exit);
}
// Visit the body of this arm
- let body_exit = self.expr(&arm.body, arm_exit);
+ let body_exit = self.expr(&arm.body, bindings_exit);
+
+ let arm_exit = self.add_ast_node(arm.hir_id.local_id, &[body_exit]);
// Link the body to the exit of the expression
- self.add_contained_edge(body_exit, expr_exit);
+ self.add_contained_edge(arm_exit, expr_exit);
}
expr_exit