Skip to content

Commit e665d20

Browse files
committed
fix a ui test
1 parent d7b6bd8 commit e665d20

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
fn main() {}
22

33
struct S {
4-
fn //~ ERROR expected identifier, found keyword `fn`
4+
fn: u8 //~ ERROR expected identifier, found keyword `fn`
55
}

src/test/ui/structs/incomplete-fn-in-struct-definition.stderr

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
error: expected identifier, found keyword `fn`
22
--> $DIR/incomplete-fn-in-struct-definition.rs:4:5
33
|
4-
LL | fn
4+
LL | struct S {
5+
| - while parsing this struct
6+
LL | fn: u8
57
| ^^ expected identifier, found keyword
68
|
79
help: escape `fn` to use it as an identifier
810
|
9-
LL | r#fn
11+
LL | r#fn: u8
1012
| ++
1113

1214
error: aborting due to previous error

0 commit comments

Comments
 (0)