From 3d738e9e0634a4cd6239d1317bd7dad53be68dc8 Mon Sep 17 00:00:00 2001 From: Marijn Haverbeke Date: Thu, 5 May 2011 15:30:21 +0200 Subject: Return a fresh, unreachable context after ret, break, and cont This ensures we don't get compile errors on unreachable code (see test/run-pass/artificial-block.rs for an example of sane code that wasn't compiling). In the future, we might want to warn about non-trivial code appearing in an unreachable context, and/or avoid generating unreachable code altogether (though I'm sure LLVM will weed it out as well). --- src/test/run-pass/artificial-block.rs | 4 ---- 1 file changed, 4 deletions(-) (limited to 'src/test') diff --git a/src/test/run-pass/artificial-block.rs b/src/test/run-pass/artificial-block.rs index 30344c4c..e09dbcc1 100644 --- a/src/test/run-pass/artificial-block.rs +++ b/src/test/run-pass/artificial-block.rs @@ -1,8 +1,4 @@ // xfail-stage0 -// xfail-stage1 -// xfail-stage2 -// xfail-stage1 -// xfail-stage2 fn f() -> int { { ret 3; } } -- cgit v1.2.3