]> git.proxmox.com Git - rustc.git/blobdiff - 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
index 7a49031bde7c2d7798542fdd99765286ac18168f..91f60e8f426c4fa552a8c5bb68c304a2cccca99f 100644 (file)
@@ -1,6 +1,9 @@
 error[E0277]: the trait bound `fn() -> impl T {foo}: T` is not satisfied
   --> $DIR/fn-ctor-passed-as-arg-where-it-should-have-been-called.rs:17:9
    |
+LL | fn foo() -> impl T<O=()> { S }
+   |    --- consider calling this function
+LL | 
 LL | fn bar(f: impl T<O=()>) {}
    |    ---         ------- required by this bound in `bar`
 ...
@@ -10,6 +13,20 @@ LL |     bar(foo);
    |         the trait `T` is not implemented for `fn() -> impl T {foo}`
    |         help: use parentheses to call the function: `foo()`
 
-error: aborting due to previous error
+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
+  --> $DIR/fn-ctor-passed-as-arg-where-it-should-have-been-called.rs:19:9
+   |
+LL | fn bar(f: impl T<O=()>) {}
+   |    ---         ------- required by this bound in `bar`
+...
+LL |     let closure = || S;
+   |                   -- consider calling this closure
+LL |     bar(closure);
+   |         ^^^^^^^
+   |         |
+   |         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]`
+   |         help: use parentheses to call the closure: `closure()`
+
+error: aborting due to 2 previous errors
 
 For more information about this error, try `rustc --explain E0277`.