]> git.lizzy.rs Git - rust.git/blob - tests/ui/unboxed-closures/unboxed-closures-generic.rs
Rollup merge of #107171 - petrochenkov:encattrs, r=cjgillot
[rust.git] / tests / ui / unboxed-closures / unboxed-closures-generic.rs
1 // run-pass
2 use std::ops::FnMut;
3
4 fn call_it<F:FnMut(i32,i32)->i32>(y: i32, mut f: F) -> i32 {
5     f(2, y)
6 }
7
8 pub fn main() {
9     let f = |x: i32, y: i32| -> i32 { x + y };
10     let z = call_it(3, f);
11     println!("{}", z);
12     assert_eq!(z, 5);
13 }