@@ -1642,24 +1642,9 @@ fn confirm_fn_pointer_candidate<'cx, 'tcx>(
16421642 sig,
16431643 ) ;
16441644
1645- let host_effect_param = match * fn_type. kind ( ) {
1646- ty:: FnDef ( def_id, args) => tcx
1647- . generics_of ( def_id)
1648- . host_effect_index
1649- . map_or ( tcx. consts . true_ , |idx| args. const_at ( idx) ) ,
1650- ty:: FnPtr ( ..) => tcx. consts . true_ ,
1651- _ => unreachable ! ( "only expected FnPtr or FnDef in `confirm_fn_pointer_candidate`" ) ,
1652- } ;
1653-
1654- confirm_callable_candidate (
1655- selcx,
1656- obligation,
1657- sig,
1658- util:: TupleArgumentsFlag :: Yes ,
1659- host_effect_param,
1660- )
1661- . with_addl_obligations ( nested)
1662- . with_addl_obligations ( obligations)
1645+ confirm_callable_candidate ( selcx, obligation, sig, util:: TupleArgumentsFlag :: Yes )
1646+ . with_addl_obligations ( nested)
1647+ . with_addl_obligations ( obligations)
16631648}
16641649
16651650fn confirm_closure_candidate < ' cx , ' tcx > (
@@ -1739,24 +1724,16 @@ fn confirm_closure_candidate<'cx, 'tcx>(
17391724
17401725 debug ! ( ?obligation, ?closure_sig, ?obligations, "confirm_closure_candidate" ) ;
17411726
1742- confirm_callable_candidate (
1743- selcx,
1744- obligation,
1745- closure_sig,
1746- util:: TupleArgumentsFlag :: No ,
1747- // FIXME(effects): This doesn't handle const closures correctly!
1748- selcx. tcx ( ) . consts . true_ ,
1749- )
1750- . with_addl_obligations ( nested)
1751- . with_addl_obligations ( obligations)
1727+ confirm_callable_candidate ( selcx, obligation, closure_sig, util:: TupleArgumentsFlag :: No )
1728+ . with_addl_obligations ( nested)
1729+ . with_addl_obligations ( obligations)
17521730}
17531731
17541732fn confirm_callable_candidate < ' cx , ' tcx > (
17551733 selcx : & mut SelectionContext < ' cx , ' tcx > ,
17561734 obligation : & ProjectionTermObligation < ' tcx > ,
17571735 fn_sig : ty:: PolyFnSig < ' tcx > ,
17581736 flag : util:: TupleArgumentsFlag ,
1759- fn_host_effect : ty:: Const < ' tcx > ,
17601737) -> Progress < ' tcx > {
17611738 let tcx = selcx. tcx ( ) ;
17621739
@@ -1771,7 +1748,6 @@ fn confirm_callable_candidate<'cx, 'tcx>(
17711748 obligation. predicate . self_ty ( ) ,
17721749 fn_sig,
17731750 flag,
1774- fn_host_effect,
17751751 )
17761752 . map_bound ( |( trait_ref, ret_type) | ty:: ProjectionPredicate {
17771753 projection_term : ty:: AliasTerm :: new_from_args ( tcx, fn_once_output_def_id, trait_ref. args ) ,
0 commit comments