mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-26 20:09:19 +00:00
Auto merge of #13160 - ChayimFriedman2:parse-parenthesized-type-path-with-coloncolon, r=jonas-schievink
fix: Parse TypePathFn with preceding `::` e.g. `impl Fn::() -> ()`. Fixes #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.
This commit is contained in:
commit
93c52e41ec
3 changed files with 49 additions and 0 deletions
|
@ -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!['(']) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue