Commit 6842017 1 parent e668d7c commit 6842017 Copy full SHA for 6842017
File tree 1 file changed +20
-10
lines changed
1 file changed +20
-10
lines changed Original file line number Diff line number Diff line change @@ -190,19 +190,29 @@ fn get_all_methods<'tcx>(
190
190
span : original_expr. span ,
191
191
} ) ;
192
192
193
- let projection_ty = ty:: AliasTy :: new ( tcx, into_iter_trait, GenericArgs :: empty ( ) ) ;
194
- let projection = ty:: Binder :: dummy ( ty:: PredicateKind :: Clause ( ty:: ClauseKind :: Projection (
195
- ty:: ProjectionPredicate {
196
- projection_ty,
197
- term : ty. into ( ) ,
198
- } ,
199
- ) ) ) ;
200
- ocx. register_obligation ( Obligation :: new (
193
+ // Construct the alias type
194
+ let alias_ty = ty:: AliasTy :: new ( tcx, into_iter_trait, GenericArgs :: empty ( ) ) ;
195
+
196
+ let projection_predicate = ty:: ProjectionPredicate {
197
+ projection_ty : alias_ty,
198
+ term : infcx
199
+ . next_ty_var ( TypeVariableOrigin {
200
+ // Create a fresh type variable for the resulting type
201
+ kind : TypeVariableOriginKind :: TypeInference ,
202
+ span : original_expr. span ,
203
+ } )
204
+ . into ( ) ,
205
+ } ;
206
+
207
+ let obligation = Obligation :: new (
201
208
tcx,
202
209
ObligationCause :: dummy ( ) ,
203
210
param_env,
204
- projection,
205
- ) ) ;
211
+ ty:: Binder :: dummy ( projection_predicate) ,
212
+ ) ;
213
+
214
+ ocx. register_obligation ( obligation) ;
215
+
206
216
let errors = ocx. select_where_possible ( ) ;
207
217
if errors. is_empty ( ) {
208
218
dbg ! ( "no errors" ) ; // TODO: do something else here
You can’t perform that action at this time.
0 commit comments