Skip to content

Commit b0db139

Browse files
committed
Revert "Use typestate constraints for trans_be"
This reverts commit 1b60bba. (Need a snapshot first)
1 parent 1b60bba commit b0db139

File tree

2 files changed

+6
-13
lines changed

2 files changed

+6
-13
lines changed

src/comp/middle/trans.rs

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4450,14 +4450,7 @@ fn trans_expr_out(cx: &@block_ctxt, e: &@ast::expr, output: out_method) ->
44504450
ast::expr_cont. { ret trans_cont(e.span, cx); }
44514451
ast::expr_ret(ex) { ret trans_ret(cx, ex); }
44524452
ast::expr_put(ex) { ret trans_put(cx, ex); }
4453-
ast::expr_be(ex) {
4454-
// Ideally, the expr_be tag would have a precondition
4455-
// that is_call_expr(ex) -- but we don't support that
4456-
// yet
4457-
// FIXME
4458-
check ast_util::is_call_expr(ex);
4459-
ret trans_be(cx, ex);
4460-
}
4453+
ast::expr_be(ex) { ret trans_be(cx, ex); }
44614454
ast::expr_anon_obj(anon_obj) {
44624455
ret trans_anon_obj(cx, e.span, anon_obj, e.id);
44634456
}
@@ -4783,10 +4776,10 @@ fn trans_ret(cx: &@block_ctxt, e: &option::t<@ast::expr>) -> result {
47834776

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

4786-
// fn trans_be(cx: &@block_ctxt, e: &@ast::expr) -> result {
4787-
fn trans_be(cx: &@block_ctxt, e: &@ast::expr)
4788-
: ast_util::is_call_expr(e) -> result {
4779+
fn trans_be(cx: &@block_ctxt, e: &@ast::expr) -> result {
4780+
// FIXME: This should be a typestate precondition
47894781

4782+
assert (ast_util::is_call_expr(e));
47904783
// FIXME: Turn this into a real tail call once
47914784
// calling convention issues are settled
47924785

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

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

0 commit comments

Comments
 (0)