mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 07:14:28 +00:00
rustc: Load structural loop variables in iterators. Un-XFAIL foreach-put-structured.rs.
This commit is contained in:
parent
28d51e3fd2
commit
6392bd1681
@ -449,7 +449,6 @@ TEST_XFAILS_RUSTC := $(addprefix test/run-pass/, \
|
||||
comm.rs \
|
||||
constrained-type.rs \
|
||||
destructor-ordering.rs \
|
||||
foreach-put-structured.rs \
|
||||
iter-ret.rs \
|
||||
lazychan.rs \
|
||||
lib-bitv.rs \
|
||||
|
@ -4512,10 +4512,19 @@ fn trans_put(@block_ctxt cx, &option.t[@ast.expr] e) -> result {
|
||||
case (none[@ast.expr]) { }
|
||||
case (some[@ast.expr](?x)) {
|
||||
auto r = trans_expr(bcx, x);
|
||||
llargs += r.val;
|
||||
|
||||
auto llarg = r.val;
|
||||
bcx = r.bcx;
|
||||
if (ty.type_is_structural(ty.expr_ty(x))) {
|
||||
// Until here we've been treating structures by pointer; we
|
||||
// are now passing it as an arg, so need to load it.
|
||||
llarg = bcx.build.Load(llarg);
|
||||
}
|
||||
|
||||
llargs += llarg;
|
||||
}
|
||||
}
|
||||
|
||||
ret res(bcx, bcx.build.FastCall(llcallee, llargs));
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user