Skip to content

Commit d9eafc4

Browse files
committed
---
yaml --- r: 185082 b: refs/heads/snap-stage3 c: 8659de0 h: refs/heads/master v: v3
1 parent 7c174db commit d9eafc4

File tree

3 files changed

+8
-13
lines changed

3 files changed

+8
-13
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: f0f7ca27de6b4e03f30012656dad270cda55a363
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 3b0cafbcd7c2fe092888b58ad5994bd280eb40b9
4+
refs/heads/snap-stage3: 8659de0334208ccb6b3a4929109275857da84e81
55
refs/heads/try: ccf8fedf1cffcb8f6f3581d53d220039e192fe77
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d

branches/snap-stage3/src/librustc_trans/trans/common.rs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -214,14 +214,7 @@ pub fn type_needs_unwind_cleanup<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>, ty: Ty<
214214
}
215215

216216
pub fn type_needs_drop<'tcx>(cx: &ty::ctxt<'tcx>, ty: Ty<'tcx>) -> bool {
217-
// Unsized types cannot be dropped automatically - these are lvalues pointing
218-
// to alloca's containing the actual data pointer (and the unsizing info),
219-
// which only be obtained by dereferencing a pointer from which moves are
220-
// not allowed. Datum & friends could possibly be adjusted to avoid getting
221-
// this far - maybe the (*data, info) aggregate could be an SSA value?
222-
// Lvalues don't have to be pointers, just behave like a pointer, but there
223-
// is no telling what other implicit assumptions are lurking around.
224-
ty::type_contents(cx, ty).needs_drop(cx) && type_is_sized(cx, ty)
217+
ty::type_contents(cx, ty).needs_drop(cx)
225218
}
226219

227220
fn type_is_newtype_immediate<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>, ty: Ty<'tcx>) -> bool {

branches/snap-stage3/src/librustc_trans/trans/expr.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -463,11 +463,13 @@ fn apply_adjustments<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
463463
let ptr_ty = type_of::in_memory_type_of(bcx.ccx(), unsized_ty).ptr_to();
464464
let base = PointerCast(bcx, lval.val, ptr_ty);
465465

466-
let scratch = rvalue_scratch_datum(bcx, unsized_ty, "__fat_ptr");
467-
Store(bcx, base, get_dataptr(bcx, scratch.val));
468-
Store(bcx, info, get_len(bcx, scratch.val));
466+
let llty = type_of::type_of(bcx.ccx(), unsized_ty);
467+
// HACK(eddyb) get around issues with lifetime intrinsics.
468+
let scratch = alloca_no_lifetime(bcx, llty, "__fat_ptr");
469+
Store(bcx, base, get_dataptr(bcx, scratch));
470+
Store(bcx, info, get_len(bcx, scratch));
469471

470-
DatumBlock::new(bcx, scratch.to_expr_datum())
472+
DatumBlock::new(bcx, Datum::new(scratch, unsized_ty, LvalueExpr))
471473
}
472474

473475
fn unsize_unique_vec<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,

0 commit comments

Comments
 (0)