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