From 20431706a863f92cb37dc512fef6e48d192aaf2c Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:11:38 +0200 Subject: Merging upstream version 1.66.0+dfsg1. Signed-off-by: Daniel Baumann --- src/test/ui/parser/fn-field-parse-error-ice.stderr | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/test/ui/parser/fn-field-parse-error-ice.stderr') diff --git a/src/test/ui/parser/fn-field-parse-error-ice.stderr b/src/test/ui/parser/fn-field-parse-error-ice.stderr index d582f61cc..3bf68e8cc 100644 --- a/src/test/ui/parser/fn-field-parse-error-ice.stderr +++ b/src/test/ui/parser/fn-field-parse-error-ice.stderr @@ -4,14 +4,18 @@ error: expected `,`, or `}`, found keyword `fn` LL | inner : dyn fn () | ^ help: try adding a comma: `,` -error: functions are not allowed in struct definitions +error: expected identifier, found keyword `fn` --> $DIR/fn-field-parse-error-ice.rs:4:17 | +LL | struct Baz { + | --- while parsing this struct LL | inner : dyn fn () - | ^^ + | ^^ expected identifier, found keyword | - = help: unlike in C++, Java, and C#, functions are declared in `impl` blocks - = help: see https://doc.rust-lang.org/book/ch05-03-method-syntax.html for more information +help: escape `fn` to use it as an identifier + | +LL | inner : dyn r#fn () + | ++ error[E0412]: cannot find type `dyn` in this scope --> $DIR/fn-field-parse-error-ice.rs:4:13 -- cgit v1.2.3