2023-12-14 06:11:28 -06:00
|
|
|
// compile-flags: -Znext-solver
|
2023-03-29 18:36:27 -05:00
|
|
|
// check-pass
|
|
|
|
|
|
|
|
fn foo(i: isize) -> isize { i + 1 }
|
|
|
|
|
|
|
|
fn apply<A, F>(f: F, v: A) -> A where F: FnOnce(A) -> A { f(v) }
|
|
|
|
|
|
|
|
pub fn main() {
|
|
|
|
let f = |i| foo(i);
|
|
|
|
assert_eq!(apply(f, 2), 3);
|
|
|
|
}
|