Skip to content

Commit 806e879

Browse files
dotdashalexcrichton
authored andcommitted
---
yaml --- r: 118980 b: refs/heads/master c: a0ec902 h: refs/heads/master v: v3
1 parent 7e446a5 commit 806e879

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: e4e3550ff6ee1754ea4d7191989044c444bff049
2+
refs/heads/master: a0ec902e239b2219edf1a18b036dd32c18d3be42
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 71fe44def9676d519f5ce5d7304e581a42cf2c70
55
refs/heads/try: 1813e5aa1a03b0596b8de7abd1af31edf5d6098f

trunk/src/librustc/middle/trans/expr.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -610,7 +610,6 @@ fn trans_rvalue_stmt_unadjusted<'a>(bcx: &'a Block<'a>,
610610
controlflow::trans_loop(bcx, expr.id, &**body)
611611
}
612612
ast::ExprAssign(ref dst, ref src) => {
613-
let src_datum = unpack_datum!(bcx, trans(bcx, &**src));
614613
let dst_datum = unpack_datum!(bcx, trans_to_lvalue(bcx, &**dst, "assign"));
615614

616615
if ty::type_needs_drop(bcx.tcx(), dst_datum.ty) {
@@ -630,12 +629,13 @@ fn trans_rvalue_stmt_unadjusted<'a>(bcx: &'a Block<'a>,
630629
//
631630
// We could avoid this intermediary with some analysis
632631
// to determine whether `dst` may possibly own `src`.
632+
let src_datum = unpack_datum!(bcx, trans(bcx, &**src));
633633
let src_datum = unpack_datum!(
634634
bcx, src_datum.to_rvalue_datum(bcx, "ExprAssign"));
635635
bcx = glue::drop_ty(bcx, dst_datum.val, dst_datum.ty);
636636
src_datum.store_to(bcx, dst_datum.val)
637637
} else {
638-
src_datum.store_to(bcx, dst_datum.val)
638+
trans_into(bcx, &**src, SaveIn(dst_datum.to_llref()))
639639
}
640640
}
641641
ast::ExprAssignOp(op, ref dst, ref src) => {

0 commit comments

Comments
 (0)