Skip to content

Commit 52d15f6

Browse files
arielb1pietroalbini
authored andcommitted
use the adjusted type for cat_pattern in tuple patterns
This looks like a typo introduced in #51686. Fixes #52213.
1 parent 47f4d15 commit 52d15f6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/librustc/middle/mem_categorization.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1342,7 +1342,7 @@ impl<'a, 'gcx, 'tcx> MemCategorizationContext<'a, 'gcx, 'tcx> {
13421342
ref ty => span_bug!(pat.span, "tuple pattern unexpected type {:?}", ty),
13431343
};
13441344
for (i, subpat) in subpats.iter().enumerate_and_adjust(expected_len, ddpos) {
1345-
let subpat_ty = self.pat_ty_unadjusted(&subpat)?; // see (*2)
1345+
let subpat_ty = self.pat_ty_adjusted(&subpat)?; // see (*2)
13461346
let interior = InteriorField(FieldIndex(i, Name::intern(&i.to_string())));
13471347
let subcmt = Rc::new(self.cat_imm_interior(pat, cmt.clone(), subpat_ty, interior));
13481348
self.cat_pattern_(subcmt, &subpat, op)?;

0 commit comments

Comments
 (0)