Skip to content

Commit 63cd81c

Browse files
committed
Add comment explaining reasoning
1 parent 5f8bf91 commit 63cd81c

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/librustc_typeck/check/_match.rs

+2
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,8 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
300300
let pat_ty = tcx.mk_ty(ty::Tuple(element_tys));
301301
if let Some(mut err) = self.demand_eqtype_diag(pat.span, expected, pat_ty) {
302302
err.emit();
303+
// Walk subpatterns with an expected type of `err` in this case to silence
304+
// further errors being emitted when using the bindings. #50333
303305
let element_tys_iter = (0..max_len).map(|_| tcx.types.err);
304306
for (_, elem) in elements.iter().enumerate_and_adjust(max_len, ddpos) {
305307
self.check_pat_walk(elem, &tcx.types.err, def_bm, true);

0 commit comments

Comments
 (0)