Merge remote-tracking branch 'origin/master'

This commit is contained in:
Oliver Schneider 2017-02-07 19:22:44 +01:00
commit fd3bbfde04
No known key found for this signature in database
GPG Key ID: A69F8D225B3AD7D9
3 changed files with 6 additions and 3 deletions

View File

@ -746,7 +746,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),

View File

@ -157,6 +157,8 @@ fn global_item(&mut self, def_id: DefId, substs: &'tcx subst::Substs<'tcx>, span
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())
});
}
@ -201,6 +203,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,

View File

@ -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 {
@ -786,7 +786,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"),