]> git.proxmox.com Git - rustc.git/blob - src/test/ui/suggestions/fn-ctor-passed-as-arg-where-it-should-have-been-called.stderr
New upstream version 1.41.1+dfsg1
[rustc.git] / src / test / ui / suggestions / fn-ctor-passed-as-arg-where-it-should-have-been-called.stderr
1 error[E0277]: the trait bound `fn() -> impl T {foo}: T` is not satisfied
2 --> $DIR/fn-ctor-passed-as-arg-where-it-should-have-been-called.rs:17:9
3 |
4 LL | fn foo() -> impl T<O=()> { S }
5 | --- consider calling this function
6 LL |
7 LL | fn bar(f: impl T<O=()>) {}
8 | --- ------- required by this bound in `bar`
9 ...
10 LL | bar(foo);
11 | ^^^
12 | |
13 | the trait `T` is not implemented for `fn() -> impl T {foo}`
14 | help: use parentheses to call the function: `foo()`
15
16 error[E0277]: the trait bound `[closure@$DIR/fn-ctor-passed-as-arg-where-it-should-have-been-called.rs:18:19: 18:23]: T` is not satisfied
17 --> $DIR/fn-ctor-passed-as-arg-where-it-should-have-been-called.rs:19:9
18 |
19 LL | fn bar(f: impl T<O=()>) {}
20 | --- ------- required by this bound in `bar`
21 ...
22 LL | let closure = || S;
23 | -- consider calling this closure
24 LL | bar(closure);
25 | ^^^^^^^
26 | |
27 | the trait `T` is not implemented for `[closure@$DIR/fn-ctor-passed-as-arg-where-it-should-have-been-called.rs:18:19: 18:23]`
28 | help: use parentheses to call the closure: `closure()`
29
30 error: aborting due to 2 previous errors
31
32 For more information about this error, try `rustc --explain E0277`.