Auto merge of #29817 - michaelwoerister:mir-ty-closure-fields, r=nikomatsakis

Add a missing case in LvalueTy::projection_ty() that popped up earlier today.

cc @rust-lang/compiler @nikomatsakis
This commit is contained in:
bors 2015-11-14 06:08:09 +00:00
commit 45087f36ce

View File

@ -79,6 +79,8 @@ impl<'tcx> LvalueTy<'tcx> {
adt_def.struct_variant().fields[field.index()].ty(tcx, substs),
ty::TyTuple(ref tys) =>
tys[field.index()],
ty::TyClosure(_, ref closure_substs) =>
closure_substs.upvar_tys[field.index()],
_ =>
tcx.sess.bug(&format!("cannot get field of type: `{:?}`", ty)),
},