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