From c3df51a976dfa69f0f1869997fdf79516ba6afab Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Sat, 9 Dec 2023 00:50:52 +0100 Subject: [PATCH] Some types cannot show up as the type of a pattern --- .../rustc_mir_build/src/thir/pattern/deconstruct_pat.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/compiler/rustc_mir_build/src/thir/pattern/deconstruct_pat.rs b/compiler/rustc_mir_build/src/thir/pattern/deconstruct_pat.rs index e66402a7eb3..ef20b0f039b 100644 --- a/compiler/rustc_mir_build/src/thir/pattern/deconstruct_pat.rs +++ b/compiler/rustc_mir_build/src/thir/pattern/deconstruct_pat.rs @@ -1101,13 +1101,12 @@ impl ConstructorSet { | ty::Dynamic(_, _, _) | ty::Closure(_, _) | ty::Coroutine(_, _, _) - | ty::CoroutineWitness(_, _) | ty::Alias(_, _) | ty::Param(_) - | ty::Bound(_, _) - | ty::Placeholder(_) - | ty::Infer(_) | ty::Error(_) => Self::Unlistable, + ty::CoroutineWitness(_, _) | ty::Bound(_, _) | ty::Placeholder(_) | ty::Infer(_) => { + bug!("Encountered unexpected type in `ConstructorSet::for_ty`: {ty:?}") + } } }