Skip to content

Commit 07d150e

Browse files
committed
---
yaml --- r: 1001 b: refs/heads/master c: 1e9c8b9 h: refs/heads/master i: 999: c965b3d v: v3
1 parent 568c108 commit 07d150e

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
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: 97247bbb531bf82382a3c1ed20460d033f1b064b
2+
refs/heads/master: 1e9c8b923d78e6169d1d99bfccf675a10f904a76

trunk/src/comp/middle/trans.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -867,8 +867,16 @@ impure fn trans_unary(@block_ctxt cx, ast.unop op,
867867
sub = copy_ty(sub.bcx, true, body, e_val, e_ty);
868868
ret res(sub.bcx, box);
869869
}
870-
case (_) {
871-
cx.fcx.ccx.sess.unimpl("expr variant in trans_unary");
870+
case (ast.deref) {
871+
sub.val = sub.bcx.build.GEP(sub.val,
872+
vec(C_int(0),
873+
C_int(abi.box_rc_field_body)));
874+
auto e_ty = node_ann_type(sub.bcx.fcx.ccx, a);
875+
if (typeck.type_is_scalar(e_ty) ||
876+
typeck.type_is_nil(e_ty)) {
877+
sub.val = sub.bcx.build.Load(sub.val);
878+
}
879+
ret sub;
872880
}
873881
}
874882
fail;

0 commit comments

Comments
 (0)