Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
oli-obk committed Feb 7, 2017
2 parents 01ac19d + 63cd994 commit fd3bbfd
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/eval_context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -746,7 +746,7 @@ impl<'a, 'tcx> EvalContext<'a, '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),
Expand Down
3 changes: 3 additions & 0 deletions src/step.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,8 @@ impl<'a, 'b, 'tcx> ConstantExtractor<'a, 'b, 'tcx> {
let mir = this.ecx.load_mir(def_id)?;
this.ecx.globals.insert(cid, Global::uninitialized(mir.return_ty));
let cleanup = StackPopCleanup::MarkStatic(!immutable || mir.return_ty.type_contents(this.ecx.tcx).interior_unsafe());
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())
});
}
Expand Down Expand Up @@ -201,6 +203,7 @@ impl<'a, 'b, 'tcx> Visitor<'tcx> for ConstantExtractor<'a, 'b, 'tcx> {
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,
Expand Down
4 changes: 2 additions & 2 deletions src/terminator/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,7 @@ impl<'a, 'tcx> EvalContext<'a, '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 {
Expand Down Expand Up @@ -786,7 +786,7 @@ impl<'a, 'tcx> EvalContext<'a, 'tcx> {
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"),
Expand Down

0 comments on commit fd3bbfd

Please sign in to comment.