]>
Commit | Line | Data |
---|---|---|
1a4d82fc | 1 | #![feature(unboxed_closures)] |
970d7e83 | 2 | |
1a4d82fc | 3 | use std::ops::FnMut; |
223e47cc | 4 | |
85aaf69f SL |
5 | fn to_fn_mut<A,F:FnMut<A>>(f: F) -> F { f } |
6 | ||
7 | fn call_it<F:FnMut(isize,isize)->isize>(y: isize, mut f: F) -> isize { | |
e1599b0c | 8 | //~^ NOTE required by this bound in `call_it` |
1a4d82fc | 9 | f(2, y) |
223e47cc LB |
10 | } |
11 | ||
12 | pub fn main() { | |
85aaf69f | 13 | let f = to_fn_mut(|x: usize, y: isize| -> isize { (x as isize) + y }); |
2c00a5a8 | 14 | //~^ NOTE found signature of `fn(usize, isize) -> _` |
85aaf69f SL |
15 | let z = call_it(3, f); |
16 | //~^ ERROR type mismatch | |
2c00a5a8 | 17 | //~| NOTE expected signature of `fn(isize, isize) -> _` |
1a4d82fc | 18 | println!("{}", z); |
223e47cc | 19 | } |