Skip to content

Commit d062ea5

Browse files
committed
---
yaml --- r: 224341 b: refs/heads/beta c: e25427a h: refs/heads/master i: 224339: f7a3735 v: v3
1 parent 7152f31 commit d062ea5

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
@@ -23,7 +23,7 @@ refs/tags/0.9: 36870b185fc5f5486636d4515f0e22677493f225
2323
refs/tags/0.10: ac33f2b15782272ae348dbd7b14b8257b2148b5a
2424
refs/tags/0.11.0: e1247cb1d0d681be034adb4b558b5a0c0d5720f9
2525
refs/tags/0.12.0: f0c419429ef30723ceaf6b42f9b5a2aeb5d2e2d1
26-
refs/heads/beta: dce1c61e977deed5e0a499f4247d5da870809692
26+
refs/heads/beta: e25427a2b287a7e9e4f7fcc72ca3c341e61c1a7d
2727
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
2828
refs/heads/tmp: 938f5d7af401e2d8238522fed4a612943b6e77fd
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f

branches/beta/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)