about summary refs log tree commit diff
diff options
context:
space:
mode:
authorNadrieril <nadrieril+git@gmail.com>2023-12-09 00:50:52 +0100
committerNadrieril <nadrieril+git@gmail.com>2023-12-09 01:22:28 +0100
commitc3df51a976dfa69f0f1869997fdf79516ba6afab (patch)
tree4fdaeb00acb1e894fd56ff696c3eb969f1066ec3
parentddef5b61f134834c81f8802d07ce3774e46143f6 (diff)
downloadrust-c3df51a976dfa69f0f1869997fdf79516ba6afab.tar.gz
rust-c3df51a976dfa69f0f1869997fdf79516ba6afab.zip
Some types cannot show up as the type of a pattern
-rw-r--r--compiler/rustc_mir_build/src/thir/pattern/deconstruct_pat.rs7
1 files 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:?}")
+            }
         }
     }