From 9a7f76889a738219ae06c04e7384d23e2ea53b97 Mon Sep 17 00:00:00 2001 From: Scott Olson Date: Tue, 7 Feb 2017 06:01:03 -0800 Subject: [PATCH 1/2] Update for changes in rustc. --- src/eval_context.rs | 2 +- src/terminator/mod.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/eval_context.rs b/src/eval_context.rs index d372f37698d..402f911e958 100644 --- a/src/eval_context.rs +++ b/src/eval_context.rs @@ -744,7 +744,7 @@ pub fn get_field_ty(&self, ty: Ty<'tcx>, field_index: usize) -> EvalResult<'tcx, Ok(adt_def.struct_variant().fields[field_index].ty(self.tcx, substs)) } - ty::TyTuple(fields) => Ok(fields[field_index]), + ty::TyTuple(fields, _) => Ok(fields[field_index]), ty::TyRef(_, ref tam) | ty::TyRawPtr(ref tam) => self.get_fat_field(tam.ty, field_index), diff --git a/src/terminator/mod.rs b/src/terminator/mod.rs index 88dd36354ca..1de5599136c 100644 --- a/src/terminator/mod.rs +++ b/src/terminator/mod.rs @@ -520,7 +520,7 @@ fn unpack_fn_args(&self, args: &mut Vec<(Value, Ty<'tcx>)>) -> EvalResult<'tcx> if let Some((last, last_ty)) = args.pop() { let last_layout = self.type_layout(last_ty)?; match (&last_ty.sty, last_layout) { - (&ty::TyTuple(fields), + (&ty::TyTuple(fields, _), &Layout::Univariant { ref variant, .. }) => { let offsets = variant.offsets.iter().map(|s| s.bytes()); let last_ptr = match last { @@ -785,7 +785,7 @@ pub fn drop( drop, )?; }, - ty::TyTuple(fields) => { + ty::TyTuple(fields, _) => { let offsets = match *self.type_layout(ty)? { Layout::Univariant { ref variant, .. } => &variant.offsets, _ => bug!("tuples must be univariant"), From 52ae8eb7941afcbe07119bf418bc15100e5c5631 Mon Sep 17 00:00:00 2001 From: Scott Olson Date: Tue, 7 Feb 2017 07:02:45 -0800 Subject: [PATCH 2/2] Log global/promoted frame creation. --- src/step.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/step.rs b/src/step.rs index 33237b84637..744cdfdbcb0 100644 --- a/src/step.rs +++ b/src/step.rs @@ -161,6 +161,8 @@ fn global_item(&mut self, def_id: DefId, substs: &'tcx subst::Substs<'tcx>, span } else { StackPopCleanup::None }; + let name = ty::tls::with(|tcx| tcx.item_path_str(def_id)); + trace!("pushing stack frame for global: {}", name); this.ecx.push_stack_frame(def_id, span, mir, substs, Lvalue::Global(cid), cleanup, Vec::new()) }); } @@ -205,6 +207,7 @@ fn visit_constant(&mut self, constant: &mir::Constant<'tcx>, location: mir::Loca self.try(|this| { let ty = this.ecx.monomorphize(mir.return_ty, this.substs); this.ecx.globals.insert(cid, Global::uninitialized(ty)); + trace!("pushing stack frame for {:?}", index); this.ecx.push_stack_frame(this.def_id, constant.span, mir,