blob: d4db7bda06e7e27d931599a17e5a062b3658976f [file] [log] [blame]
error[E0631]: type mismatch in function arguments
--> $DIR/fn-variance-1.rs:11:5
|
LL | fn takes_mut(x: &mut isize) { }
| --------------------------- found signature of `for<'r> fn(&'r mut isize) -> _`
LL |
LL | fn apply<T, F>(t: T, f: F) where F: FnOnce(T) {
| --------------------------------------------- required by `apply`
...
LL | apply(&3, takes_mut);
| ^^^^^ expected signature of `fn(&{integer}) -> _`
error[E0631]: type mismatch in function arguments
--> $DIR/fn-variance-1.rs:15:5
|
LL | fn takes_imm(x: &isize) { }
| ----------------------- found signature of `for<'r> fn(&'r isize) -> _`
...
LL | fn apply<T, F>(t: T, f: F) where F: FnOnce(T) {
| --------------------------------------------- required by `apply`
...
LL | apply(&mut 3, takes_imm);
| ^^^^^ expected signature of `fn(&mut {integer}) -> _`
error: aborting due to 2 previous errors