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