@@ -403,6 +403,9 @@ fn program_clauses_that_could_match<I: Interner>(
403
403
let trait_datum = db. trait_datum ( trait_id) ;
404
404
405
405
match self_ty. kind ( interner) {
406
+ TyKind :: InferenceVar ( _, _) => {
407
+ panic ! ( "Inference vars not allowed when getting program clauses" )
408
+ }
406
409
TyKind :: Alias ( alias) => {
407
410
// An alias could normalize to anything, including `dyn trait`
408
411
// or an opaque type, so push a clause that asks for the
@@ -590,6 +593,9 @@ fn program_clauses_that_could_match<I: Interner>(
590
593
let trait_datum = db. trait_datum ( trait_id) ;
591
594
592
595
let self_ty = alias. self_type_parameter ( interner) ;
596
+ if let TyKind :: InferenceVar ( _, _) = self_ty. kind ( interner) {
597
+ panic ! ( "Inference vars not allowed when getting program clauses" ) ;
598
+ }
593
599
594
600
// Flounder if the self-type is unknown and the trait is non-enumerable.
595
601
//
@@ -847,6 +853,9 @@ fn match_ty<I: Interner>(
847
853
) -> Result < ( ) , Floundered > {
848
854
let interner = builder. interner ( ) ;
849
855
Ok ( match ty. kind ( interner) {
856
+ TyKind :: InferenceVar ( _, _) => {
857
+ panic ! ( "Inference vars not allowed when getting program clauses" )
858
+ }
850
859
TyKind :: Adt ( adt_id, _) => builder
851
860
. db
852
861
. adt_datum ( * adt_id)
@@ -890,7 +899,7 @@ fn match_ty<I: Interner>(
890
899
TyKind :: Function ( _quantified_ty) => {
891
900
builder. push_fact ( WellFormed :: Ty ( ty. clone ( ) ) ) ;
892
901
}
893
- TyKind :: BoundVar ( _) | TyKind :: InferenceVar ( _ , _ ) => return Err ( Floundered ) ,
902
+ TyKind :: BoundVar ( _) => return Err ( Floundered ) ,
894
903
TyKind :: Dyn ( dyn_ty) => {
895
904
// FIXME(#203)
896
905
// - Object safety? (not needed with RFC 2027)
0 commit comments