Skip to content

Commit 805349a

Browse files
committed
Bug fix: Rvalue(ByRef) will issue a lifetime_end as its post_store, which is wrong.
Kudos to dotdash for tracking down this fix. Presumably the use of `ByRef` was because this value is a reference to the drop-flag; but an Lvalue will serve just as well for that. dotdash argues: > since the drop_flag is in its "final home", Lvalue seems to be the > correct choice.
1 parent 24f213d commit 805349a

File tree

1 file changed

+1
-1
lines changed
  • src/librustc_trans/trans

1 file changed

+1
-1
lines changed

src/librustc_trans/trans/adt.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1061,7 +1061,7 @@ pub fn trans_drop_flag_ptr<'blk, 'tcx>(mut bcx: Block<'blk, 'tcx>, r: &Repr<'tcx
10611061
));
10621062
bcx = fold_variants(bcx, r, val, |variant_cx, st, value| {
10631063
let ptr = struct_field_ptr(variant_cx, st, value, (st.fields.len() - 1), false);
1064-
datum::Datum::new(ptr, ptr_ty, datum::Rvalue::new(datum::ByRef))
1064+
datum::Datum::new(ptr, ptr_ty, datum::Lvalue)
10651065
.store_to(variant_cx, scratch.val)
10661066
});
10671067
let expr_datum = scratch.to_expr_datum();

0 commit comments

Comments
 (0)