]> git.lizzy.rs Git - rust.git/blob - src/test/ui/suggestions/fn-ctor-passed-as-arg-where-it-should-have-been-called.stderr
Rollup merge of #90420 - GuillaumeGomez:rustdoc-internals-feature, r=camelid
[rust.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 ...
7 LL |     bar(foo);
8    |     --- ^^^ the trait `T` is not implemented for `fn() -> impl T {foo}`
9    |     |
10    |     required by a bound introduced by this call
11    |
12 note: required by a bound in `bar`
13   --> $DIR/fn-ctor-passed-as-arg-where-it-should-have-been-called.rs:14:16
14    |
15 LL | fn bar(f: impl T<O=()>) {}
16    |                ^^^^^^^ required by this bound in `bar`
17 help: use parentheses to call the function
18    |
19 LL |     bar(foo());
20    |            ++
21
22 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
23   --> $DIR/fn-ctor-passed-as-arg-where-it-should-have-been-called.rs:19:9
24    |
25 LL |     let closure = || S;
26    |                   -- consider calling this closure
27 LL |     bar(closure);
28    |     --- ^^^^^^^ 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]`
29    |     |
30    |     required by a bound introduced by this call
31    |
32 note: required by a bound in `bar`
33   --> $DIR/fn-ctor-passed-as-arg-where-it-should-have-been-called.rs:14:16
34    |
35 LL | fn bar(f: impl T<O=()>) {}
36    |                ^^^^^^^ required by this bound in `bar`
37 help: use parentheses to call the closure
38    |
39 LL |     bar(closure());
40    |                ++
41
42 error: aborting due to 2 previous errors
43
44 For more information about this error, try `rustc --explain E0277`.