Skip to content

Commit f24408d

Browse files
committed
Don't error when trans_lval is called on a non-lval
This allows directly calling a function expression, or the result of an alt/if/block expression.
1 parent 6142c73 commit f24408d

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/comp/middle/trans.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5069,9 +5069,11 @@ fn trans_lval(&@block_ctxt cx, &@ast::expr e) -> lval_result {
50695069
}
50705070
}
50715071
case (_) {
5072-
cx.fcx.lcx.ccx.sess.span_unimpl(e.span,
5073-
"expr variant in trans_lval: "
5074-
+ expr_to_str(e));
5072+
ret rec(res=trans_expr(cx, e),
5073+
is_mem=false,
5074+
generic=none,
5075+
llobj=none,
5076+
method_ty=none);
50755077
}
50765078
}
50775079
}

0 commit comments

Comments
 (0)