Use proper span for break and continue labels

Fixes #28109
This commit is contained in:
Simonas Kazlauskas 2015-09-02 22:29:41 +03:00
parent cd138dc447
commit d8074e65b0
9 changed files with 32 additions and 23 deletions

View file

@ -284,7 +284,7 @@ impl<'a, 'tcx> CFGBuilder<'a, 'tcx> {
}
hir::ExprBreak(label) => {
let loop_scope = self.find_scope(expr, label);
let loop_scope = self.find_scope(expr, label.map(|l| l.node));
let b = self.add_ast_node(expr.id, &[pred]);
self.add_exiting_edge(expr, b,
loop_scope, loop_scope.break_index);
@ -292,7 +292,7 @@ impl<'a, 'tcx> CFGBuilder<'a, 'tcx> {
}
hir::ExprAgain(label) => {
let loop_scope = self.find_scope(expr, label);
let loop_scope = self.find_scope(expr, label.map(|l| l.node));
let a = self.add_ast_node(expr.id, &[pred]);
self.add_exiting_edge(expr, a,
loop_scope, loop_scope.continue_index);