1 error[E0631]: type mismatch in function arguments
2 --> $DIR/fn-variance-1.rs:11:15
4 LL | fn takes_mut(x: &mut isize) { }
5 | --------------------------- found signature of `for<'r> fn(&'r mut isize) -> _`
7 LL | apply(&3, takes_mut);
8 | ----- ^^^^^^^^^ expected signature of `fn(&{integer}) -> _`
10 | required by a bound introduced by this call
12 note: required by a bound in `apply`
13 --> $DIR/fn-variance-1.rs:5:37
15 LL | fn apply<T, F>(t: T, f: F) where F: FnOnce(T) {
16 | ^^^^^^^^^ required by this bound in `apply`
18 error[E0631]: type mismatch in function arguments
19 --> $DIR/fn-variance-1.rs:15:19
21 LL | fn takes_imm(x: &isize) { }
22 | ----------------------- found signature of `for<'r> fn(&'r isize) -> _`
24 LL | apply(&mut 3, takes_imm);
25 | ----- ^^^^^^^^^ expected signature of `fn(&mut {integer}) -> _`
27 | required by a bound introduced by this call
29 note: required by a bound in `apply`
30 --> $DIR/fn-variance-1.rs:5:37
32 LL | fn apply<T, F>(t: T, f: F) where F: FnOnce(T) {
33 | ^^^^^^^^^ required by this bound in `apply`
35 error: aborting due to 2 previous errors
37 For more information about this error, try `rustc --explain E0631`.