From 4f9fe856a25ab29345b90e7725509e9ee38a37be Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:19:41 +0200 Subject: Adding upstream version 1.69.0+dfsg1. Signed-off-by: Daniel Baumann --- tests/ui/static/static-reference-to-fn-1.stderr | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'tests/ui/static/static-reference-to-fn-1.stderr') diff --git a/tests/ui/static/static-reference-to-fn-1.stderr b/tests/ui/static/static-reference-to-fn-1.stderr index 67b478bdb..b68352b51 100644 --- a/tests/ui/static/static-reference-to-fn-1.stderr +++ b/tests/ui/static/static-reference-to-fn-1.stderr @@ -2,10 +2,16 @@ error[E0308]: mismatched types --> $DIR/static-reference-to-fn-1.rs:17:15 | LL | func: &foo, - | ^^^^ expected fn pointer, found fn item + | ^^^^ expected `&fn() -> Option`, found `&fn() -> Option {foo}` | = note: expected reference `&fn() -> Option` found reference `&fn() -> Option {foo}` + = note: fn items are distinct from fn pointers + = note: when the arguments and return types match, functions can be coerced to function pointers +help: consider casting to a fn pointer + | +LL | func: &(foo as fn() -> Option), + | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error: aborting due to previous error -- cgit v1.2.3