Skip to content

Commit

Permalink
Fix overflow in type checking of tuple patterns
Browse files Browse the repository at this point in the history
  • Loading branch information
petrochenkov committed May 26, 2016
1 parent 35ef09c commit 0ca9bf3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/librustc_typeck/check/_match.rs
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ impl<'a, 'gcx, 'tcx> PatCtxt<'a, 'gcx, 'tcx> {
let pat_ty = tcx.mk_tup(element_tys.clone());
self.write_ty(pat.id, pat_ty);
self.demand_eqtype(pat.span, expected, pat_ty);
for (i, elem) in elements.iter().enumerate_and_adjust(expected_len, ddpos) {
for (i, elem) in elements.iter().enumerate_and_adjust(max_len, ddpos) {
self.check_pat(elem, &element_tys[i]);
}
}
Expand Down

0 comments on commit 0ca9bf3

Please sign in to comment.