1
Fork 0

Rollup merge of #123648 - oli-obk:pattern_types_syntax, r=compiler-errors

Avoid ICEing without the pattern_types feature gate

fixes  #123643
This commit is contained in:
Matthias Krüger 2024-04-09 06:02:23 +02:00 committed by GitHub
commit 727c31a797
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 44 additions and 2 deletions

View file

@ -2249,7 +2249,11 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
Ty::new_pat(tcx, ty, pat)
}
hir::PatKind::Err(e) => Ty::new_error(tcx, e),
_ => span_bug!(pat.span, "unsupported pattern for pattern type: {pat:#?}"),
_ => Ty::new_error_with_message(
tcx,
pat.span,
format!("unsupported pattern for pattern type: {pat:#?}"),
),
};
self.record_ty(pat.hir_id, ty, pat.span);
pat_ty