]> git.lizzy.rs Git - rust.git/blob - tests/ui/mismatched_types/fn-variance-1.stderr
Rollup merge of #106889 - scottmcm:windows-mut, r=cuviper
[rust.git] / tests / ui / mismatched_types / fn-variance-1.stderr
1 error[E0631]: type mismatch in function arguments
2   --> $DIR/fn-variance-1.rs:11:15
3    |
4 LL | fn takes_mut(x: &mut isize) { }
5    | --------------------------- found signature defined here
6 ...
7 LL |     apply(&3, takes_mut);
8    |     -----     ^^^^^^^^^ expected due to this
9    |     |
10    |     required by a bound introduced by this call
11    |
12    = note: expected function signature `fn(&{integer}) -> _`
13               found function signature `for<'a> fn(&'a mut isize) -> _`
14 note: required by a bound in `apply`
15   --> $DIR/fn-variance-1.rs:5:37
16    |
17 LL | fn apply<T, F>(t: T, f: F) where F: FnOnce(T) {
18    |                                     ^^^^^^^^^ required by this bound in `apply`
19
20 error[E0631]: type mismatch in function arguments
21   --> $DIR/fn-variance-1.rs:15:19
22    |
23 LL | fn takes_imm(x: &isize) { }
24    | ----------------------- found signature defined here
25 ...
26 LL |     apply(&mut 3, takes_imm);
27    |     -----         ^^^^^^^^^ expected due to this
28    |     |
29    |     required by a bound introduced by this call
30    |
31    = note: expected function signature `fn(&mut {integer}) -> _`
32               found function signature `for<'a> fn(&'a isize) -> _`
33 note: required by a bound in `apply`
34   --> $DIR/fn-variance-1.rs:5:37
35    |
36 LL | fn apply<T, F>(t: T, f: F) where F: FnOnce(T) {
37    |                                     ^^^^^^^^^ required by this bound in `apply`
38
39 error: aborting due to 2 previous errors
40
41 For more information about this error, try `rustc --explain E0631`.