Skip to content

Commit 45087f3

Browse files
committed
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
2 parents 32202cc + 9211883 commit 45087f3

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
@@ -79,6 +79,8 @@ impl<'tcx> LvalueTy<'tcx> {
7979
adt_def.struct_variant().fields[field.index()].ty(tcx, substs),
8080
ty::TyTuple(ref tys) =>
8181
tys[field.index()],
82+
ty::TyClosure(_, ref closure_substs) =>
83+
closure_substs.upvar_tys[field.index()],
8284
_ =>
8385
tcx.sess.bug(&format!("cannot get field of type: `{:?}`", ty)),
8486
},

0 commit comments

Comments
 (0)