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 rust-lang#51686.

Fixes rust-lang#52213.
  • Loading branch information
arielb1 authored and Mark-Simulacrum committed Jul 18, 2018
1 parent 5f2b325 commit 14655a6
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 @@ -1325,7 +1325,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 14655a6

Please sign in to comment.