From 64d98f8ee037282c35007b64c2649055c56af1db Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:19:03 +0200 Subject: Merging upstream version 1.68.2+dfsg1. Signed-off-by: Daniel Baumann --- ...-as-arg-where-it-should-have-been-called.stderr | 39 ++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 tests/ui/suggestions/fn-ctor-passed-as-arg-where-it-should-have-been-called.stderr (limited to 'tests/ui/suggestions/fn-ctor-passed-as-arg-where-it-should-have-been-called.stderr') diff --git a/tests/ui/suggestions/fn-ctor-passed-as-arg-where-it-should-have-been-called.stderr b/tests/ui/suggestions/fn-ctor-passed-as-arg-where-it-should-have-been-called.stderr new file mode 100644 index 000000000..955148315 --- /dev/null +++ b/tests/ui/suggestions/fn-ctor-passed-as-arg-where-it-should-have-been-called.stderr @@ -0,0 +1,39 @@ +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 | bar(foo); + | --- ^^^ the trait `T` is not implemented for fn item `fn() -> impl T {foo}` + | | + | required by a bound introduced by this call + | +note: required by a bound in `bar` + --> $DIR/fn-ctor-passed-as-arg-where-it-should-have-been-called.rs:14:16 + | +LL | fn bar(f: impl T) {} + | ^^^^^^^ required by this bound in `bar` +help: use parentheses to call this function + | +LL | bar(foo()); + | ++ + +error[E0277]: the trait bound `[closure@$DIR/fn-ctor-passed-as-arg-where-it-should-have-been-called.rs:18:19: 18:21]: T` is not satisfied + --> $DIR/fn-ctor-passed-as-arg-where-it-should-have-been-called.rs:19:9 + | +LL | bar(closure); + | --- ^^^^^^^ the trait `T` is not implemented for closure `[closure@$DIR/fn-ctor-passed-as-arg-where-it-should-have-been-called.rs:18:19: 18:21]` + | | + | required by a bound introduced by this call + | +note: required by a bound in `bar` + --> $DIR/fn-ctor-passed-as-arg-where-it-should-have-been-called.rs:14:16 + | +LL | fn bar(f: impl T) {} + | ^^^^^^^ required by this bound in `bar` +help: use parentheses to call this closure + | +LL | bar(closure()); + | ++ + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0277`. -- cgit v1.2.3