From feefb66ebd967e0c9e81e01a814351ab3bc07495 Mon Sep 17 00:00:00 2001 From: Oliver Schneider Date: Thu, 3 Nov 2016 13:30:54 +0100 Subject: [PATCH] recursively drop Box...>> --- src/interpreter/terminator/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/interpreter/terminator/mod.rs b/src/interpreter/terminator/mod.rs index 38768483d1d8..aad6238fdf8c 100644 --- a/src/interpreter/terminator/mod.rs +++ b/src/interpreter/terminator/mod.rs @@ -478,9 +478,9 @@ impl<'a, 'tcx> EvalContext<'a, 'tcx> { // TODO(solson): Call user-defined Drop::drop impls. match ty.sty { - ty::TyBox(_contents_ty) => { + ty::TyBox(contents_ty) => { let contents_ptr = val.read_ptr(&self.memory)?; - // self.drop(contents_ptr, contents_ty)?; + self.drop(Value::ByRef(contents_ptr), contents_ty)?; trace!("-deallocating box"); self.memory.deallocate(contents_ptr)?; }