forked from rust-lang/rust
-
-
Notifications
You must be signed in to change notification settings - Fork 0
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#13160 - ChayimFriedman2:parse-parenthesized-t…
…ype-path-with-coloncolon, r=jonas-schievink fix: Parse TypePathFn with preceding `::` e.g. `impl Fn::() -> ()`. Fixes rust-lang#13157. This was the problem, not that the path was not at the end. I could unify the parsing of `::` of TypePathFn with that of generic arg list, but some code relies on the `::` of generic arg list to be inside it.
- Loading branch information
Showing
3 changed files
with
49 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
43 changes: 43 additions & 0 deletions
43
crates/parser/test_data/parser/inline/ok/0202_typepathfn_with_coloncolon.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,43 @@ | ||
SOURCE_FILE | ||
TYPE_ALIAS | ||
TYPE_KW "type" | ||
WHITESPACE " " | ||
NAME | ||
IDENT "F" | ||
WHITESPACE " " | ||
EQ "=" | ||
WHITESPACE " " | ||
PATH_TYPE | ||
PATH | ||
PATH | ||
PATH_SEGMENT | ||
NAME_REF | ||
IDENT "Start" | ||
COLON2 "::" | ||
PARAM_LIST | ||
L_PAREN "(" | ||
PARAM | ||
PATH_TYPE | ||
PATH | ||
PATH_SEGMENT | ||
NAME_REF | ||
IDENT "Middle" | ||
R_PAREN ")" | ||
WHITESPACE " " | ||
RET_TYPE | ||
THIN_ARROW "->" | ||
WHITESPACE " " | ||
PAREN_TYPE | ||
L_PAREN "(" | ||
PATH_TYPE | ||
PATH | ||
PATH_SEGMENT | ||
NAME_REF | ||
IDENT "Middle" | ||
R_PAREN ")" | ||
COLON2 "::" | ||
PATH_SEGMENT | ||
NAME_REF | ||
IDENT "End" | ||
SEMICOLON ";" | ||
WHITESPACE "\n" |
1 change: 1 addition & 0 deletions
1
crates/parser/test_data/parser/inline/ok/0202_typepathfn_with_coloncolon.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 @@ | ||
type F = Start::(Middle) -> (Middle)::End; |