Skip to content

Commit 9211883

Browse files
MIR: Support closure up-vars in LvalueTy::projection_ty()
1 parent b12a358 commit 9211883

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/librustc_mir/tcx/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@ impl<'tcx> LvalueTy<'tcx> {
7878
adt_def.struct_variant().fields[field.index()].ty(tcx, substs),
7979
ty::TyTuple(ref tys) =>
8080
tys[field.index()],
81+
ty::TyClosure(_, ref closure_substs) =>
82+
closure_substs.upvar_tys[field.index()],
8183
_ =>
8284
tcx.sess.bug(&format!("cannot get field of type: `{:?}`", ty)),
8385
},

0 commit comments

Comments
 (0)