Skip to content

Commit 8d36bd4

Browse files
committed
---
yaml --- r: 185821 b: refs/heads/auto c: 8659de0 h: refs/heads/master i: 185819: 7fb88f8 v: v3
1 parent 0f1470e commit 8d36bd4

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
@@ -10,7 +10,7 @@ refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1010
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1111
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1212
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
13-
refs/heads/auto: 3b0cafbcd7c2fe092888b58ad5994bd280eb40b9
13+
refs/heads/auto: 8659de0334208ccb6b3a4929109275857da84e81
1414
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1515
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1616
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

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