forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of rust-lang#15994 - ChayimFriedman2:err-comma-after-fus, …
…r=Veykril fix: Err for comma after functional update syntax Error message copied from rustc, https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=20aeedb2db504c4e4ced54b665e761d6. Fixes rust-lang#15989.
- Loading branch information
Showing
3 changed files
with
81 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
66 changes: 66 additions & 0 deletions
66
crates/parser/test_data/parser/inline/err/0024_comma_after_functional_update_syntax.rast
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
SOURCE_FILE | ||
FN | ||
FN_KW "fn" | ||
WHITESPACE " " | ||
NAME | ||
IDENT "foo" | ||
PARAM_LIST | ||
L_PAREN "(" | ||
R_PAREN ")" | ||
WHITESPACE " " | ||
BLOCK_EXPR | ||
STMT_LIST | ||
L_CURLY "{" | ||
WHITESPACE "\n " | ||
EXPR_STMT | ||
RECORD_EXPR | ||
PATH | ||
PATH_SEGMENT | ||
NAME_REF | ||
IDENT "S" | ||
WHITESPACE " " | ||
RECORD_EXPR_FIELD_LIST | ||
L_CURLY "{" | ||
WHITESPACE " " | ||
DOT2 ".." | ||
PATH_EXPR | ||
PATH | ||
PATH_SEGMENT | ||
NAME_REF | ||
IDENT "x" | ||
COMMA "," | ||
WHITESPACE " " | ||
R_CURLY "}" | ||
SEMICOLON ";" | ||
WHITESPACE "\n " | ||
RECORD_EXPR | ||
PATH | ||
PATH_SEGMENT | ||
NAME_REF | ||
IDENT "S" | ||
WHITESPACE " " | ||
RECORD_EXPR_FIELD_LIST | ||
L_CURLY "{" | ||
WHITESPACE " " | ||
DOT2 ".." | ||
PATH_EXPR | ||
PATH | ||
PATH_SEGMENT | ||
NAME_REF | ||
IDENT "x" | ||
COMMA "," | ||
WHITESPACE " " | ||
RECORD_EXPR_FIELD | ||
NAME_REF | ||
IDENT "a" | ||
COLON ":" | ||
WHITESPACE " " | ||
LITERAL | ||
INT_NUMBER "0" | ||
WHITESPACE " " | ||
R_CURLY "}" | ||
WHITESPACE "\n" | ||
R_CURLY "}" | ||
WHITESPACE "\n" | ||
error 22: cannot use a comma after the base struct | ||
error 38: cannot use a comma after the base struct |
4 changes: 4 additions & 0 deletions
4
crates/parser/test_data/parser/inline/err/0024_comma_after_functional_update_syntax.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
fn foo() { | ||
S { ..x, }; | ||
S { ..x, a: 0 } | ||
} |