Merge pull request #1871 from uHOOCCOOHu/never_loop_fix
Fix the bug remaining in #1586.
This commit is contained in:
commit
fd7dda097b
2 changed files with 11 additions and 0 deletions
|
|
@ -466,6 +466,7 @@ fn contains_continue_decl(decl: &Decl, dest: &NodeId) -> bool {
|
|||
|
||||
fn contains_continue_expr(expr: &Expr, dest: &NodeId) -> bool {
|
||||
match expr.node {
|
||||
ExprRet(Some(ref e)) |
|
||||
ExprBox(ref e) |
|
||||
ExprUnary(_, ref e) |
|
||||
ExprCast(ref e, _) |
|
||||
|
|
|
|||
|
|
@ -103,6 +103,15 @@ fn test10() {
|
|||
}
|
||||
}
|
||||
|
||||
fn test11<F: FnMut() -> i32>(mut f: F) {
|
||||
loop {
|
||||
return match f() {
|
||||
1 => continue,
|
||||
_ => (),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {
|
||||
test1();
|
||||
test2();
|
||||
|
|
@ -114,5 +123,6 @@ fn main() {
|
|||
test8();
|
||||
test9();
|
||||
test10();
|
||||
test11(|| 0);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue