Skip to content

Commit

Permalink
use the adjusted type for cat_pattern in tuple patterns
Browse files Browse the repository at this point in the history
This looks like a typo introduced in #51686.

Fixes #52213.
  • Loading branch information
arielb1 committed Jul 10, 2018
1 parent c6807bb commit 05d6e55
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/librustc/middle/mem_categorization.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1347,7 +1347,7 @@ impl<'a, 'gcx, 'tcx> MemCategorizationContext<'a, 'gcx, 'tcx> {
ref ty => span_bug!(pat.span, "tuple pattern unexpected type {:?}", ty),
};
for (i, subpat) in subpats.iter().enumerate_and_adjust(expected_len, ddpos) {
let subpat_ty = self.pat_ty_unadjusted(&subpat)?; // see (*2)
let subpat_ty = self.pat_ty_adjusted(&subpat)?; // see (*2)
let interior = InteriorField(FieldIndex(i, Name::intern(&i.to_string())));
let subcmt = Rc::new(self.cat_imm_interior(pat, cmt.clone(), subpat_ty, interior));
self.cat_pattern_(subcmt, &subpat, op)?;
Expand Down

0 comments on commit 05d6e55

Please sign in to comment.