aboutsummaryrefslogtreecommitdiff
path: root/crates/parser/src/grammar/items/traits.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/parser/src/grammar/items/traits.rs')
-rw-r--r--crates/parser/src/grammar/items/traits.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/crates/parser/src/grammar/items/traits.rs b/crates/parser/src/grammar/items/traits.rs
index 8394020da..ab9a12b4d 100644
--- a/crates/parser/src/grammar/items/traits.rs
+++ b/crates/parser/src/grammar/items/traits.rs
@@ -98,10 +98,10 @@ fn choose_type_params_over_qpath(p: &Parser) -> bool {
98 // `<` `>` - empty generic parameters 98 // `<` `>` - empty generic parameters
99 // `<` `#` - generic parameters with attributes 99 // `<` `#` - generic parameters with attributes
100 // `<` `const` - const generic parameters 100 // `<` `const` - const generic parameters
101 // `<` (LIFETIME|IDENT) `>` - single generic parameter 101 // `<` (LIFETIME_IDENT|IDENT) `>` - single generic parameter
102 // `<` (LIFETIME|IDENT) `,` - first generic parameter in a list 102 // `<` (LIFETIME_IDENT|IDENT) `,` - first generic parameter in a list
103 // `<` (LIFETIME|IDENT) `:` - generic parameter with bounds 103 // `<` (LIFETIME_IDENT|IDENT) `:` - generic parameter with bounds
104 // `<` (LIFETIME|IDENT) `=` - generic parameter with a default 104 // `<` (LIFETIME_IDENT|IDENT) `=` - generic parameter with a default
105 // The only truly ambiguous case is 105 // The only truly ambiguous case is
106 // `<` IDENT `>` `::` IDENT ... 106 // `<` IDENT `>` `::` IDENT ...
107 // we disambiguate it in favor of generics (`impl<T> ::absolute::Path<T> { ... }`) 107 // we disambiguate it in favor of generics (`impl<T> ::absolute::Path<T> { ... }`)
@@ -113,7 +113,7 @@ fn choose_type_params_over_qpath(p: &Parser) -> bool {
113 if p.nth(1) == T![#] || p.nth(1) == T![>] || p.nth(1) == CONST_KW { 113 if p.nth(1) == T![#] || p.nth(1) == T![>] || p.nth(1) == CONST_KW {
114 return true; 114 return true;
115 } 115 }
116 (p.nth(1) == LIFETIME || p.nth(1) == IDENT) 116 (p.nth(1) == LIFETIME_IDENT || p.nth(1) == IDENT)
117 && (p.nth(2) == T![>] || p.nth(2) == T![,] || p.nth(2) == T![:] || p.nth(2) == T![=]) 117 && (p.nth(2) == T![>] || p.nth(2) == T![,] || p.nth(2) == T![:] || p.nth(2) == T![=])
118} 118}
119 119