Skip to content

Commit 76018cd

Browse files
committed
Some types cannot show up as the type of a pattern.
1 parent ddef5b6 commit 76018cd

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

compiler/rustc_mir_build/src/thir/pattern/deconstruct_pat.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -1101,13 +1101,14 @@ impl ConstructorSet {
11011101
| ty::Dynamic(_, _, _)
11021102
| ty::Closure(_, _)
11031103
| ty::Coroutine(_, _, _)
1104-
| ty::CoroutineWitness(_, _)
11051104
| ty::Alias(_, _)
11061105
| ty::Param(_)
11071106
| ty::Bound(_, _)
11081107
| ty::Placeholder(_)
1109-
| ty::Infer(_)
11101108
| ty::Error(_) => Self::Unlistable,
1109+
ty::CoroutineWitness(_, _) | ty::Infer(_) => {
1110+
bug!("Encountered unexpected type in `ConstructorSet::for_ty`: {ty:?}")
1111+
}
11111112
}
11121113
}
11131114

0 commit comments

Comments
 (0)