-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Parse contextual dyn keyword properly in edition 2015
- Loading branch information
Showing
10 changed files
with
164 additions
and
11 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
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
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
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
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
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
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
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
113 changes: 113 additions & 0 deletions
113
crates/parser/test_data/parser/inline/ok/dyn_trait_type_weak.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,113 @@ | ||
SOURCE_FILE | ||
TYPE_ALIAS | ||
COMMENT "// 2015" | ||
WHITESPACE "\n" | ||
TYPE_KW "type" | ||
WHITESPACE " " | ||
NAME | ||
IDENT "A" | ||
WHITESPACE " " | ||
EQ "=" | ||
WHITESPACE " " | ||
DYN_TRAIT_TYPE | ||
DYN_KW "dyn" | ||
WHITESPACE " " | ||
TYPE_BOUND_LIST | ||
TYPE_BOUND | ||
PATH_TYPE | ||
PATH | ||
PATH_SEGMENT | ||
NAME_REF | ||
IDENT "Iterator" | ||
GENERIC_ARG_LIST | ||
L_ANGLE "<" | ||
ASSOC_TYPE_ARG | ||
NAME_REF | ||
IDENT "Item" | ||
EQ "=" | ||
PATH_TYPE | ||
PATH | ||
PATH_SEGMENT | ||
NAME_REF | ||
IDENT "Foo" | ||
GENERIC_ARG_LIST | ||
L_ANGLE "<" | ||
LIFETIME_ARG | ||
LIFETIME | ||
LIFETIME_IDENT "'a" | ||
R_ANGLE ">" | ||
R_ANGLE ">" | ||
WHITESPACE " " | ||
PLUS "+" | ||
WHITESPACE " " | ||
TYPE_BOUND | ||
LIFETIME | ||
LIFETIME_IDENT "'a" | ||
SEMICOLON ";" | ||
WHITESPACE "\n" | ||
TYPE_ALIAS | ||
TYPE_KW "type" | ||
WHITESPACE " " | ||
NAME | ||
IDENT "A" | ||
WHITESPACE " " | ||
EQ "=" | ||
WHITESPACE " " | ||
REF_TYPE | ||
AMP "&" | ||
DYN_TRAIT_TYPE | ||
DYN_KW "dyn" | ||
WHITESPACE " " | ||
TYPE_BOUND_LIST | ||
TYPE_BOUND | ||
PATH_TYPE | ||
PATH | ||
PATH_SEGMENT | ||
NAME_REF | ||
IDENT "Iterator" | ||
GENERIC_ARG_LIST | ||
L_ANGLE "<" | ||
ASSOC_TYPE_ARG | ||
NAME_REF | ||
IDENT "Item" | ||
EQ "=" | ||
PATH_TYPE | ||
PATH | ||
PATH_SEGMENT | ||
NAME_REF | ||
IDENT "Foo" | ||
GENERIC_ARG_LIST | ||
L_ANGLE "<" | ||
LIFETIME_ARG | ||
LIFETIME | ||
LIFETIME_IDENT "'a" | ||
R_ANGLE ">" | ||
R_ANGLE ">" | ||
WHITESPACE " " | ||
PLUS "+" | ||
WHITESPACE " " | ||
TYPE_BOUND | ||
LIFETIME | ||
LIFETIME_IDENT "'a" | ||
SEMICOLON ";" | ||
WHITESPACE "\n" | ||
TYPE_ALIAS | ||
TYPE_KW "type" | ||
WHITESPACE " " | ||
NAME | ||
IDENT "A" | ||
WHITESPACE " " | ||
EQ "=" | ||
WHITESPACE " " | ||
PATH_TYPE | ||
PATH | ||
PATH | ||
PATH_SEGMENT | ||
NAME_REF | ||
IDENT "dyn" | ||
COLON2 "::" | ||
PATH_SEGMENT | ||
NAME_REF | ||
IDENT "Path" | ||
SEMICOLON ";" | ||
WHITESPACE "\n" |
4 changes: 4 additions & 0 deletions
4
crates/parser/test_data/parser/inline/ok/dyn_trait_type_weak.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 @@ | ||
// 2015 | ||
type A = dyn Iterator<Item=Foo<'a>> + 'a; | ||
type A = &dyn Iterator<Item=Foo<'a>> + 'a; | ||
type A = dyn::Path; |