]> git.lizzy.rs Git - rust.git/blob - tests/ui/closures/multiple-fn-bounds.stderr
Rollup merge of #106625 - Swatinem:ref/cov6, r=nagisa
[rust.git] / tests / ui / closures / multiple-fn-bounds.stderr
1 error[E0631]: type mismatch in closure arguments
2   --> $DIR/multiple-fn-bounds.rs:10:5
3    |
4 LL |     foo(move |x| v);
5    |     ^^^ -------- found signature defined here
6    |     |
7    |     expected due to this
8    |
9    = note: expected closure signature `fn(char) -> _`
10               found closure signature `for<'a> fn(&'a char) -> _`
11 note: closure inferred to have a different signature due to this bound
12   --> $DIR/multiple-fn-bounds.rs:1:11
13    |
14 LL | fn foo<F: Fn(&char) -> bool + Fn(char) -> bool>(f: F) {
15    |           ^^^^^^^^^^^^^^^^^
16 note: required by a bound in `foo`
17   --> $DIR/multiple-fn-bounds.rs:1:31
18    |
19 LL | fn foo<F: Fn(&char) -> bool + Fn(char) -> bool>(f: F) {
20    |                               ^^^^^^^^^^^^^^^^ required by this bound in `foo`
21 help: do not borrow the argument
22    |
23 LL |     foo(move |char| v);
24    |               ~~~~
25
26 error: aborting due to previous error
27
28 For more information about this error, try `rustc --explain E0631`.