@@ -258,7 +258,7 @@ pub(in crate::solve) fn extract_tupled_inputs_and_output_from_callable<I: Intern
258258 if sig. skip_binder ( ) . is_fn_trait_compatible ( ) && !tcx. has_target_features ( def_id) {
259259 Ok ( Some (
260260 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 ( ) ) ) ,
262262 ) )
263263 } else {
264264 Err ( NoSolution )
@@ -267,7 +267,9 @@ pub(in crate::solve) fn extract_tupled_inputs_and_output_from_callable<I: Intern
267267 // keep this in sync with assemble_fn_pointer_candidates until the old solver is removed.
268268 ty:: FnPtr ( sig) => {
269269 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+ ) )
271273 } else {
272274 Err ( NoSolution )
273275 }
@@ -290,7 +292,9 @@ pub(in crate::solve) fn extract_tupled_inputs_and_output_from_callable<I: Intern
290292 }
291293 }
292294 }
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+ ) )
294298 }
295299
296300 // 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:
468472 let future_output_ty = Ty :: new_projection ( tcx, future_output_def_id, [ sig. output ( ) ] ) ;
469473 Ok ( (
470474 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 ( ) ) ,
472476 output_coroutine_ty : sig. output ( ) ,
473477 coroutine_return_ty : future_output_ty,
474478 } ) ,
@@ -519,7 +523,7 @@ pub(in crate::solve) fn extract_tupled_inputs_and_output_from_async_callable<I:
519523 let future_output_ty = Ty :: new_projection ( tcx, future_output_def_id, [ sig. output ( ) ] ) ;
520524 Ok ( (
521525 bound_sig. rebind ( AsyncCallableRelevantTypes {
522- tupled_inputs_ty : sig. inputs ( ) [ 0 ] ,
526+ tupled_inputs_ty : sig. inputs ( ) . get ( 0 ) . unwrap ( ) ,
523527 output_coroutine_ty : sig. output ( ) ,
524528 coroutine_return_ty : future_output_ty,
525529 } ) ,
0 commit comments