@@ -258,7 +258,7 @@ pub(in crate::solve) fn extract_tupled_inputs_and_output_from_callable<I: Intern
258
258
if sig. skip_binder ( ) . is_fn_trait_compatible ( ) && !tcx. has_target_features ( def_id) {
259
259
Ok ( Some (
260
260
sig. instantiate ( tcx, args)
261
- . map_bound ( |sig| ( Ty :: new_tup ( tcx, & sig. inputs ( ) ) , sig. output ( ) ) ) ,
261
+ . map_bound ( |sig| ( Ty :: new_tup ( tcx, sig. inputs ( ) . as_slice ( ) ) , sig. output ( ) ) ) ,
262
262
) )
263
263
} else {
264
264
Err ( NoSolution )
@@ -267,7 +267,9 @@ pub(in crate::solve) fn extract_tupled_inputs_and_output_from_callable<I: Intern
267
267
// keep this in sync with assemble_fn_pointer_candidates until the old solver is removed.
268
268
ty:: FnPtr ( sig) => {
269
269
if sig. is_fn_trait_compatible ( ) {
270
- Ok ( Some ( sig. map_bound ( |sig| ( Ty :: new_tup ( tcx, & sig. inputs ( ) ) , sig. output ( ) ) ) ) )
270
+ Ok ( Some (
271
+ sig. map_bound ( |sig| ( Ty :: new_tup ( tcx, sig. inputs ( ) . as_slice ( ) ) , sig. output ( ) ) ) ,
272
+ ) )
271
273
} else {
272
274
Err ( NoSolution )
273
275
}
@@ -290,7 +292,9 @@ pub(in crate::solve) fn extract_tupled_inputs_and_output_from_callable<I: Intern
290
292
}
291
293
}
292
294
}
293
- Ok ( Some ( closure_args. sig ( ) . map_bound ( |sig| ( sig. inputs ( ) [ 0 ] , sig. output ( ) ) ) ) )
295
+ Ok ( Some (
296
+ closure_args. sig ( ) . map_bound ( |sig| ( sig. inputs ( ) . get ( 0 ) . unwrap ( ) , sig. output ( ) ) ) ,
297
+ ) )
294
298
}
295
299
296
300
// Coroutine-closures don't implement `Fn` traits the normal way.
@@ -468,7 +472,7 @@ pub(in crate::solve) fn extract_tupled_inputs_and_output_from_async_callable<I:
468
472
let future_output_ty = Ty :: new_projection ( tcx, future_output_def_id, [ sig. output ( ) ] ) ;
469
473
Ok ( (
470
474
bound_sig. rebind ( AsyncCallableRelevantTypes {
471
- tupled_inputs_ty : Ty :: new_tup ( tcx, & sig. inputs ( ) ) ,
475
+ tupled_inputs_ty : Ty :: new_tup ( tcx, sig. inputs ( ) . as_slice ( ) ) ,
472
476
output_coroutine_ty : sig. output ( ) ,
473
477
coroutine_return_ty : future_output_ty,
474
478
} ) ,
@@ -519,7 +523,7 @@ pub(in crate::solve) fn extract_tupled_inputs_and_output_from_async_callable<I:
519
523
let future_output_ty = Ty :: new_projection ( tcx, future_output_def_id, [ sig. output ( ) ] ) ;
520
524
Ok ( (
521
525
bound_sig. rebind ( AsyncCallableRelevantTypes {
522
- tupled_inputs_ty : sig. inputs ( ) [ 0 ] ,
526
+ tupled_inputs_ty : sig. inputs ( ) . get ( 0 ) . unwrap ( ) ,
523
527
output_coroutine_ty : sig. output ( ) ,
524
528
coroutine_return_ty : future_output_ty,
525
529
} ) ,
0 commit comments