diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/comp/middle/ty.rs | 2 | ||||
| -rw-r--r-- | src/test/run-pass/artificial-block.rs | 12 |
2 files changed, 13 insertions, 1 deletions
diff --git a/src/comp/middle/ty.rs b/src/comp/middle/ty.rs index 220adcb1..1d170514 100644 --- a/src/comp/middle/ty.rs +++ b/src/comp/middle/ty.rs @@ -1905,7 +1905,7 @@ fn expr_ann(&@ast.expr e) -> ast.ann { // instead of "fn(&T) -> T with T = int". If this isn't what you want, see // expr_ty_params_and_ty() below. fn expr_ty(ctxt cx, @ast.expr expr) -> t { - { ret ann_to_monotype(cx, expr_ann(expr)); } + ret ann_to_monotype(cx, expr_ann(expr)); } fn expr_ty_params_and_ty(ctxt cx, @ast.expr expr) -> tup(vec[t], t) { diff --git a/src/test/run-pass/artificial-block.rs b/src/test/run-pass/artificial-block.rs new file mode 100644 index 00000000..a47787e0 --- /dev/null +++ b/src/test/run-pass/artificial-block.rs @@ -0,0 +1,12 @@ +// xfail-stage0 +// xfail-stage1 +// xfail-stage2 +fn f() -> int { + { ret 3; } +} + +fn main() { + assert(f() == 3); +} + + |