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

@ -937,10 +937,10 @@ fn trans_rvalue_stmt_unadjusted<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
trans_into(bcx, &**e, Ignore)
}
hir::ExprBreak(label_opt) => {
controlflow::trans_break(bcx, expr, label_opt)
controlflow::trans_break(bcx, expr, label_opt.map(|l| l.node))
}
hir::ExprAgain(label_opt) => {
controlflow::trans_cont(bcx, expr, label_opt)
controlflow::trans_cont(bcx, expr, label_opt.map(|l| l.node))
}
hir::ExprRet(ref ex) => {
// Check to see if the return expression itself is reachable.