File tree Expand file tree Collapse file tree 4 files changed +5
-5
lines changed
Expand file tree Collapse file tree 4 files changed +5
-5
lines changed Original file line number Diff line number Diff line change 1515
1616fn call_it ( f : Box < FnMut ( String ) -> String > ) { }
1717
18- fn call_this ( f: | & str| : Send ) { }
18+ fn call_this < F > ( f : F ) where F : Fn ( & str ) + Send { }
1919
20- fn call_that( f: <' a >| & ' a int , & ' a int | -> int ) { }
20+ fn call_that < F > ( f : F ) where F : for < ' a > Fn ( & ' a int , & ' a int ) -> int { }
2121
2222fn call_extern ( f : fn ( ) -> int ) { }
2323
Original file line number Diff line number Diff line change 1414// preserved. They are needed to disambiguate `{return n+1}; - 0` from
1515// `({return n+1}-0)`.
1616
17- fn id ( f: || -> int) -> int { f ( ) }
17+ fn id < F > ( f : F ) -> int where F : Fn ( ) -> int { f ( ) }
1818
1919fn wsucc ( _n : int ) -> int { id ( || { 1 } ) - 0 }
2020fn main ( ) { }
Original file line number Diff line number Diff line change 1010
1111// pp-exact
1212
13- fn f ( f: | int| ) { f ( 10 ) }
13+ fn f < F > ( f : F ) where F : Fn ( int ) { f ( 10 ) }
1414
1515fn main ( ) { f ( |i| { assert ! ( i == 10 ) } ) }
Original file line number Diff line number Diff line change 1111// pp-exact
1212
1313fn from_foreign_fn ( _x : fn ( ) ) { }
14- fn from_stack_closure ( _x: || ) { }
14+ fn from_stack_closure < F > ( _x : F ) where F : Fn ( ) { }
1515fn main ( ) { }
You can’t perform that action at this time.
0 commit comments