@@ -24,15 +24,16 @@ pub(super) fn instantiate_constituent_tys_for_auto_trait<'tcx>(
24
24
| ty:: Never
25
25
| ty:: Char => Ok ( vec ! [ ] ) ,
26
26
27
- ty:: Placeholder ( ..)
28
- | ty:: Dynamic ( ..)
27
+ ty:: Dynamic ( ..)
29
28
| ty:: Param ( ..)
30
29
| ty:: Foreign ( ..)
31
30
| ty:: Alias ( ty:: Projection , ..)
32
- | ty:: Bound ( ..)
33
- | ty:: Infer ( ty:: TyVar ( _) ) => Err ( NoSolution ) ,
31
+ | ty:: Placeholder ( ..) => Err ( NoSolution ) ,
34
32
35
- ty:: Infer ( ty:: FreshTy ( _) | ty:: FreshIntTy ( _) | ty:: FreshFloatTy ( _) ) => bug ! ( ) ,
33
+ ty:: Bound ( ..)
34
+ | ty:: Infer ( ty:: TyVar ( _) | ty:: FreshTy ( _) | ty:: FreshIntTy ( _) | ty:: FreshFloatTy ( _) ) => {
35
+ bug ! ( "unexpected type `{ty}`" )
36
+ }
36
37
37
38
ty:: RawPtr ( ty:: TypeAndMut { ty : element_ty, .. } ) | ty:: Ref ( _, element_ty, _) => {
38
39
Ok ( vec ! [ element_ty] )
@@ -99,11 +100,12 @@ pub(super) fn instantiate_constituent_tys_for_sized_trait<'tcx>(
99
100
| ty:: Foreign ( ..)
100
101
| ty:: Alias ( ..)
101
102
| ty:: Param ( _)
102
- | ty:: Infer ( ty :: TyVar ( _ ) ) => Err ( NoSolution ) ,
103
+ | ty:: Placeholder ( .. ) => Err ( NoSolution ) ,
103
104
104
- ty:: Placeholder ( ..)
105
- | ty:: Bound ( ..)
106
- | ty:: Infer ( ty:: FreshTy ( _) | ty:: FreshIntTy ( _) | ty:: FreshFloatTy ( _) ) => bug ! ( ) ,
105
+ ty:: Bound ( ..)
106
+ | ty:: Infer ( ty:: TyVar ( _) | ty:: FreshTy ( _) | ty:: FreshIntTy ( _) | ty:: FreshFloatTy ( _) ) => {
107
+ bug ! ( "unexpected type `{ty}`" )
108
+ }
107
109
108
110
ty:: Tuple ( tys) => Ok ( tys. to_vec ( ) ) ,
109
111
@@ -148,11 +150,12 @@ pub(super) fn instantiate_constituent_tys_for_copy_clone_trait<'tcx>(
148
150
| ty:: Adt ( _, _)
149
151
| ty:: Alias ( _, _)
150
152
| ty:: Param ( _)
151
- | ty:: Infer ( ty :: TyVar ( _ ) ) => Err ( NoSolution ) ,
153
+ | ty:: Placeholder ( .. ) => Err ( NoSolution ) ,
152
154
153
- ty:: Placeholder ( ..)
154
- | ty:: Bound ( ..)
155
- | ty:: Infer ( ty:: FreshTy ( _) | ty:: FreshIntTy ( _) | ty:: FreshFloatTy ( _) ) => bug ! ( ) ,
155
+ ty:: Bound ( ..)
156
+ | ty:: Infer ( ty:: TyVar ( _) | ty:: FreshTy ( _) | ty:: FreshIntTy ( _) | ty:: FreshFloatTy ( _) ) => {
157
+ bug ! ( "unexpected type `{ty}`" )
158
+ }
156
159
157
160
ty:: Tuple ( tys) => Ok ( tys. to_vec ( ) ) ,
158
161
@@ -215,9 +218,13 @@ pub(crate) fn extract_tupled_inputs_and_output_from_callable<'tcx>(
215
218
| ty:: Tuple ( _)
216
219
| ty:: Alias ( _, _)
217
220
| ty:: Param ( _)
218
- | ty:: Placeholder ( _)
219
- | ty:: Bound ( _, _)
220
- | ty:: Infer ( _)
221
+ | ty:: Placeholder ( ..)
222
+ | ty:: Infer ( ty:: IntVar ( _) | ty:: FloatVar ( _) )
221
223
| ty:: Error ( _) => Err ( NoSolution ) ,
224
+
225
+ ty:: Bound ( ..)
226
+ | ty:: Infer ( ty:: TyVar ( _) | ty:: FreshTy ( _) | ty:: FreshIntTy ( _) | ty:: FreshFloatTy ( _) ) => {
227
+ bug ! ( "unexpected type `{self_ty}`" )
228
+ }
222
229
}
223
230
}
0 commit comments