@@ -1642,24 +1642,9 @@ fn confirm_fn_pointer_candidate<'cx, 'tcx>(
1642
1642
sig,
1643
1643
) ;
1644
1644
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)
1663
1648
}
1664
1649
1665
1650
fn confirm_closure_candidate < ' cx , ' tcx > (
@@ -1739,24 +1724,16 @@ fn confirm_closure_candidate<'cx, 'tcx>(
1739
1724
1740
1725
debug ! ( ?obligation, ?closure_sig, ?obligations, "confirm_closure_candidate" ) ;
1741
1726
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)
1752
1730
}
1753
1731
1754
1732
fn confirm_callable_candidate < ' cx , ' tcx > (
1755
1733
selcx : & mut SelectionContext < ' cx , ' tcx > ,
1756
1734
obligation : & ProjectionTermObligation < ' tcx > ,
1757
1735
fn_sig : ty:: PolyFnSig < ' tcx > ,
1758
1736
flag : util:: TupleArgumentsFlag ,
1759
- fn_host_effect : ty:: Const < ' tcx > ,
1760
1737
) -> Progress < ' tcx > {
1761
1738
let tcx = selcx. tcx ( ) ;
1762
1739
@@ -1771,7 +1748,6 @@ fn confirm_callable_candidate<'cx, 'tcx>(
1771
1748
obligation. predicate . self_ty ( ) ,
1772
1749
fn_sig,
1773
1750
flag,
1774
- fn_host_effect,
1775
1751
)
1776
1752
. map_bound ( |( trait_ref, ret_type) | ty:: ProjectionPredicate {
1777
1753
projection_term : ty:: AliasTerm :: new_from_args ( tcx, fn_once_output_def_id, trait_ref. args ) ,
0 commit comments