diff options
| author | Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de> | 2024-04-08 21:02:13 +0000 |
|---|---|---|
| committer | Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de> | 2024-04-08 21:02:13 +0000 |
| commit | 24ee9b9423465ea4b1cc482e5aaf3a38758b2167 (patch) | |
| tree | bcd3d8748de1cf19be9aed004b1f5e48dfeb66b4 /compiler | |
| parent | 07310e21d42fdbed374d0e76924fdbce1644bae7 (diff) | |
| download | rust-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.rs | 6 |
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 |
