Skip to content

Commit abf6f47

Browse files
committed
Forward entire ptr used for dealloaction to machine
Also, demote some debug! to trace!
1 parent 1279a59 commit abf6f47

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

src/librustc_mir/interpret/eval_context.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -358,11 +358,11 @@ impl<'a, 'mir, 'tcx: 'mir, M: Machine<'a, 'mir, 'tcx>> EvalContext<'a, 'mir, 'tc
358358
// and it also rounds up to alignment, which we want to avoid,
359359
// as the unsized field's alignment could be smaller.
360360
assert!(!layout.ty.is_simd());
361-
debug!("DST layout: {:?}", layout);
361+
trace!("DST layout: {:?}", layout);
362362

363363
let sized_size = layout.fields.offset(layout.fields.count() - 1);
364364
let sized_align = layout.align;
365-
debug!(
365+
trace!(
366366
"DST {} statically sized prefix size: {:?} align: {:?}",
367367
layout.ty,
368368
sized_size,

src/librustc_mir/interpret/machine.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ pub trait Machine<'a, 'mir, 'tcx>: Sized {
194194
#[inline]
195195
fn memory_deallocated(
196196
_alloc: &mut Allocation<Self::PointerTag, Self::AllocExtra>,
197-
_id: AllocId,
197+
_ptr: Pointer<Self::PointerTag>,
198198
) -> EvalResult<'tcx> {
199199
Ok(())
200200
}

src/librustc_mir/interpret/memory.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ impl<'a, 'mir, 'tcx, M: Machine<'a, 'mir, 'tcx>> Memory<'a, 'mir, 'tcx, M> {
190190
size_and_align: Option<(Size, Align)>,
191191
kind: MemoryKind<M::MemoryKinds>,
192192
) -> EvalResult<'tcx> {
193-
debug!("deallocating: {}", ptr.alloc_id);
193+
trace!("deallocating: {}", ptr.alloc_id);
194194

195195
if ptr.offset.bytes() != 0 {
196196
return err!(DeallocateNonBasePtr);
@@ -232,7 +232,7 @@ impl<'a, 'mir, 'tcx, M: Machine<'a, 'mir, 'tcx>> Memory<'a, 'mir, 'tcx, M> {
232232
}
233233

234234
// Let the machine take some extra action
235-
M::memory_deallocated(&mut alloc, ptr.alloc_id)?;
235+
M::memory_deallocated(&mut alloc, ptr)?;
236236

237237
// Don't forget to remember size and align of this now-dead allocation
238238
let old = self.dead_alloc_map.insert(

src/librustc_mir/interpret/traits.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ impl<'a, 'mir, 'tcx, M: Machine<'a, 'mir, 'tcx>> EvalContext<'a, 'mir, 'tcx, M>
2626
ty: Ty<'tcx>,
2727
poly_trait_ref: ty::PolyExistentialTraitRef<'tcx>,
2828
) -> EvalResult<'tcx, Pointer<M::PointerTag>> {
29-
debug!("get_vtable(trait_ref={:?})", poly_trait_ref);
29+
trace!("get_vtable(trait_ref={:?})", poly_trait_ref);
3030

3131
let (ty, poly_trait_ref) = self.tcx.erase_regions(&(ty, poly_trait_ref));
3232

0 commit comments

Comments
 (0)