diff options
| author | Lindsey Kuper <[email protected]> | 2011-04-07 13:49:27 -0700 |
|---|---|---|
| committer | Graydon Hoare <[email protected]> | 2011-04-07 14:26:34 -0700 |
| commit | 1092bbfff0cf932ef14e5b92cd54133571ca4727 (patch) | |
| tree | a771667972fb8f75d393372032d5f05c03b3b68d /src/comp/middle/trans.rs | |
| parent | Add a very basic crate-dump utility (diff) | |
| download | rust-1092bbfff0cf932ef14e5b92cd54133571ca4727.tar.xz rust-1092bbfff0cf932ef14e5b92cd54133571ca4727.zip | |
Support for self-calls that take arguments.
Nicer parsing of self-calls (expr_self_method nodes inside expr_call
nodes, rather than a separate expr_call_self) makes typechecking
tractable. We can now write self-calls that take arguments and return
values (see: test/run-pass/obj-self-*.rs).
Diffstat (limited to 'src/comp/middle/trans.rs')
| -rw-r--r-- | src/comp/middle/trans.rs | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/src/comp/middle/trans.rs b/src/comp/middle/trans.rs index e1660b3f..5a8ce98b 100644 --- a/src/comp/middle/trans.rs +++ b/src/comp/middle/trans.rs @@ -3911,10 +3911,7 @@ fn trans_lval(@block_ctxt cx, @ast.expr e) -> lval_result { C_int(abi.box_rc_field_body))); ret lval_mem(sub.bcx, val); } - - // Kind of bizarre to pass an *entire* self-call here...but let's try - // it - case (ast.expr_call_self(?ident, _, ?ann)) { + case (ast.expr_self_method(?ident, ?ann)) { alt (cx.fcx.llself) { case (some[self_vt](?s_vt)) { auto r = s_vt.v; @@ -4765,11 +4762,6 @@ fn trans_expr(@block_ctxt cx, @ast.expr e) -> result { ret trans_call(cx, f, none[ValueRef], args, ann); } - case (ast.expr_call_self(?ident, ?args, ?ann)) { - // A weird hack to make self-calls work. - ret trans_call(cx, e, none[ValueRef], args, ann); - } - case (ast.expr_cast(?e, _, ?ann)) { ret trans_cast(cx, e, ann); } |