Skip to content

Commit aa8ef72

Browse files
committed
---
yaml --- r: 228853 b: refs/heads/try c: e25427a h: refs/heads/master i: 228851: add11c2 v: v3
1 parent 08edc16 commit aa8ef72

File tree

2 files changed

+17
-17
lines changed

2 files changed

+17
-17
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: aca2057ed5fb7af3f8905b2bc01f72fa001c35c8
33
refs/heads/snap-stage3: 1af31d4974e33027a68126fa5a5a3c2c6491824f
4-
refs/heads/try: dce1c61e977deed5e0a499f4247d5da870809692
4+
refs/heads/try: e25427a2b287a7e9e4f7fcc72ca3c341e61c1a7d
55
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
66
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
77
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try/src/librustc_trans/trans/expr.rs

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1004,22 +1004,22 @@ fn trans_rvalue_stmt_unadjusted<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
10041004
debuginfo::set_source_location(bcx.fcx, expr.id, expr.span);
10051005
let src_datum = unpack_datum!(
10061006
bcx, src_datum.to_rvalue_datum(bcx, "ExprAssign"));
1007-
if let Some(hint_datum) = dst_datum.kind.drop_flag_info.hint_datum(bcx) {
1008-
let hint_val = hint_datum.to_value();
1009-
// XXX the checkpointed branch only does the
1010-
// drop_ty call within this branch (and I claim
1011-
// that seems like a bug). At this point I have
1012-
// moved it into the branch solely to see if it
1013-
// makes my plague of bugs go away.
1014-
bcx = glue::drop_ty_core(bcx,
1015-
dst_datum.val,
1016-
dst_datum.ty,
1017-
expr.debug_loc(),
1018-
false,
1019-
Some(hint_val));
1020-
// We are initializing or overwriting the
1021-
// destination, so we need to write "drop needed"
1022-
// into the hint.
1007+
let opt_hint_datum = dst_datum.kind.drop_flag_info.hint_datum(bcx);
1008+
let opt_hint_val = opt_hint_datum.map(|d|d.to_value());
1009+
1010+
// 1. Drop the data at the destination, passing the
1011+
// drop-hint in case the lvalue has already been
1012+
// dropped or moved.
1013+
bcx = glue::drop_ty_core(bcx,
1014+
dst_datum.val,
1015+
dst_datum.ty,
1016+
expr.debug_loc(),
1017+
false,
1018+
opt_hint_val);
1019+
1020+
// 2. We are overwriting the destination; ensure that
1021+
// its drop-hint (if any) says "initialized."
1022+
if let Some(hint_val) = opt_hint_val {
10231023
let hint_llval = hint_val.value();
10241024
let drop_needed = C_u8(bcx.fcx.ccx, adt::DTOR_NEEDED_HINT as usize);
10251025
Store(bcx, drop_needed, hint_llval);

0 commit comments

Comments
 (0)