]> git.lizzy.rs Git - rust.git/blob - tests/ui/traits/issue-99875.stderr
Auto merge of #107843 - bjorn3:sync_cg_clif-2023-02-09, r=bjorn3
[rust.git] / tests / ui / traits / issue-99875.stderr
1 error[E0277]: the trait bound `fn(Argument) -> Return {function}: Trait` is not satisfied
2   --> $DIR/issue-99875.rs:12:11
3    |
4 LL |     takes(function);
5    |     ----- ^^^^^^^^ the trait `Trait` is not implemented for fn item `fn(Argument) -> Return {function}`
6    |     |
7    |     required by a bound introduced by this call
8    |
9 note: required by a bound in `takes`
10   --> $DIR/issue-99875.rs:9:18
11    |
12 LL | fn takes(_: impl Trait) {}
13    |                  ^^^^^ required by this bound in `takes`
14 help: the trait `Trait` is implemented for fn pointer `fn(Argument) -> Return`, try casting using `as`
15    |
16 LL |     takes(function as fn(Argument) -> Return);
17    |                    +++++++++++++++++++++++++
18
19 error[E0277]: the trait bound `[closure@$DIR/issue-99875.rs:14:11: 14:34]: Trait` is not satisfied
20   --> $DIR/issue-99875.rs:14:11
21    |
22 LL |     takes(|_: Argument| -> Return { todo!() });
23    |     ----- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Trait` is not implemented for closure `[closure@$DIR/issue-99875.rs:14:11: 14:34]`
24    |     |
25    |     required by a bound introduced by this call
26    |
27    = help: the trait `Trait` is implemented for fn pointer `fn(Argument) -> Return`
28 note: required by a bound in `takes`
29   --> $DIR/issue-99875.rs:9:18
30    |
31 LL | fn takes(_: impl Trait) {}
32    |                  ^^^^^ required by this bound in `takes`
33
34 error: aborting due to 2 previous errors
35
36 For more information about this error, try `rustc --explain E0277`.