Parse TypePathFn with preceding ::

e.g. `impl Fn::() -> ()`.
This commit is contained in:
Chayim Refael Friedman 2022-08-31 23:19:09 +00:00
parent 989b09d20c
commit d786a40e73
3 changed files with 49 additions and 0 deletions

View file

@ -118,6 +118,11 @@ fn opt_path_type_args(p: &mut Parser<'_>, mode: Mode) {
match mode {
Mode::Use => {}
Mode::Type => {
// test typepathfn_with_coloncolon
// type F = Start::(Middle) -> (Middle)::End;
if p.at(T![::]) && p.nth_at(2, T!['(']) {
p.bump(T![::]);
}
// test path_fn_trait_args
// type F = Box<Fn(i32) -> ()>;
if p.at(T!['(']) {