Skip to content

Commit

Permalink
Auto merge of #29817 - michaelwoerister:mir-ty-closure-fields, r=niko…
Browse files Browse the repository at this point in the history
…matsakis

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

cc @rust-lang/compiler @nikomatsakis
  • Loading branch information
bors committed Nov 14, 2015
2 parents 32202cc + 9211883 commit 45087f3
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/librustc_mir/tcx/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)),
},
Expand Down

0 comments on commit 45087f3

Please sign in to comment.