MIR: Support closure up-vars in LvalueTy::projection_ty()

This commit is contained in:
Michael Woerister
2015-11-13 17:01:37 +01:00
parent b12a3582b1
commit 9211883e54
+2
View File
@@ -78,6 +78,8 @@ pub fn projection_ty(self,
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)),
},