about summary refs log tree commit diff
path: root/compiler
diff options
context:
space:
mode:
authorOli Scherer <git-spam-no-reply9815368754983@oli-obk.de>2024-04-08 21:02:13 +0000
committerOli Scherer <git-spam-no-reply9815368754983@oli-obk.de>2024-04-08 21:02:13 +0000
commit24ee9b9423465ea4b1cc482e5aaf3a38758b2167 (patch)
treebcd3d8748de1cf19be9aed004b1f5e48dfeb66b4 /compiler
parent07310e21d42fdbed374d0e76924fdbce1644bae7 (diff)
downloadrust-24ee9b9423465ea4b1cc482e5aaf3a38758b2167.tar.gz
rust-24ee9b9423465ea4b1cc482e5aaf3a38758b2167.zip
Avoid ICEing without the `pattern_types` feature gate
Diffstat (limited to 'compiler')
-rw-r--r--compiler/rustc_hir_analysis/src/hir_ty_lowering/mod.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/compiler/rustc_hir_analysis/src/hir_ty_lowering/mod.rs b/compiler/rustc_hir_analysis/src/hir_ty_lowering/mod.rs
index ebfccd27d17..59f0fac5aa7 100644
--- a/compiler/rustc_hir_analysis/src/hir_ty_lowering/mod.rs
+++ b/compiler/rustc_hir_analysis/src/hir_ty_lowering/mod.rs
@@ -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