Skip to content

Commit 3067d3e

Browse files
committed
---
yaml --- r: 4950 b: refs/heads/master c: c02f346 h: refs/heads/master v: v3
1 parent 14c0b44 commit 3067d3e

File tree

3 files changed

+14
-7
lines changed

3 files changed

+14
-7
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: 5472d2238ad2339869255bc8905a82b01a2b3c27
2+
refs/heads/master: c02f346e2cdc80ef476ff625b59613acf62ccf87

trunk/src/comp/middle/trans.rs

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4441,7 +4441,14 @@ fn trans_expr_out(cx: &@block_ctxt, e: &@ast::expr, output: out_method) ->
44414441
ast::expr_cont. { ret trans_cont(e.span, cx); }
44424442
ast::expr_ret(ex) { ret trans_ret(cx, ex); }
44434443
ast::expr_put(ex) { ret trans_put(cx, ex); }
4444-
ast::expr_be(ex) { ret trans_be(cx, ex); }
4444+
ast::expr_be(ex) {
4445+
// Ideally, the expr_be tag would have a precondition
4446+
// that is_call_expr(ex) -- but we don't support that
4447+
// yet
4448+
// FIXME
4449+
check ast_util::is_call_expr(ex);
4450+
ret trans_be(cx, ex);
4451+
}
44454452
ast::expr_anon_obj(anon_obj) {
44464453
ret trans_anon_obj(cx, e.span, anon_obj, e.id);
44474454
}
@@ -4762,10 +4769,10 @@ fn trans_ret(cx: &@block_ctxt, e: &option::t<@ast::expr>) -> result {
47624769

47634770
fn build_return(bcx: &@block_ctxt) { bld::Br(bcx, bcx_fcx(bcx).llreturn); }
47644771

4765-
fn trans_be(cx: &@block_ctxt, e: &@ast::expr) -> result {
4766-
// FIXME: This should be a typestate precondition
4772+
// fn trans_be(cx: &@block_ctxt, e: &@ast::expr) -> result {
4773+
fn trans_be(cx: &@block_ctxt, e: &@ast::expr)
4774+
: ast_util::is_call_expr(e) -> result {
47674775

4768-
assert (ast_util::is_call_expr(e));
47694776
// FIXME: Turn this into a real tail call once
47704777
// calling convention issues are settled
47714778

trunk/src/comp/syntax/ast_util.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,8 @@ fn is_exported(i: ident, m: _mod) -> bool {
167167
ret count == 0u && !nonlocal;
168168
}
169169

170-
fn is_call_expr(e: @expr) -> bool {
171-
alt e.node { expr_call(_, _) { ret true; } _ { ret false; } }
170+
pure fn is_call_expr(e: @expr) -> bool {
171+
alt e.node { expr_call(_, _) { true } _ { false } }
172172
}
173173

174174
fn is_constraint_arg(e: @expr) -> bool {

0 commit comments

Comments
 (0)