2018-08-30 07:18:55 -05:00
|
|
|
// run-pass
|
2015-01-05 12:53:39 -06:00
|
|
|
// Tests calls to closure arguments where the closure takes 2 arguments.
|
|
|
|
// This is a bit tricky due to rust-call ABI.
|
|
|
|
|
2015-03-22 15:13:15 -05:00
|
|
|
|
2019-05-28 13:47:21 -05:00
|
|
|
fn foo(f: &mut dyn FnMut(isize, isize) -> isize) -> isize {
|
2015-01-05 12:53:39 -06:00
|
|
|
f(1, 2)
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let z = foo(&mut |x, y| x * 10 + y);
|
|
|
|
assert_eq!(z, 12);
|
|
|
|
}
|