1
Fork 0

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.
This commit is contained in:
Marijn Haverbeke 2011-06-14 21:37:49 +02:00
parent 6142c731a0
commit f24408d89a

View file

@ -5069,9 +5069,11 @@ fn trans_lval(&@block_ctxt cx, &@ast::expr e) -> lval_result {
}
}
case (_) {
cx.fcx.lcx.ccx.sess.span_unimpl(e.span,
"expr variant in trans_lval: "
+ expr_to_str(e));
ret rec(res=trans_expr(cx, e),
is_mem=false,
generic=none,
llobj=none,
method_ty=none);
}
}
}