rustc: Remove the artificial block in ty.rs. Fixes self-hosting. Add a test case for this, XFAIL'd.

This commit is contained in:
Patrick Walton 2011-05-02 17:44:22 -07:00
parent 147a2d655f
commit a833f152ba
2 changed files with 13 additions and 1 deletions

View File

@ -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) {

View File

@ -0,0 +1,12 @@
// xfail-stage0
// xfail-stage1
// xfail-stage2
fn f() -> int {
{ ret 3; }
}
fn main() {
assert(f() == 3);
}