aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_syntax/src/grammar/items/traits.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_syntax/src/grammar/items/traits.rs')
-rw-r--r--crates/ra_syntax/src/grammar/items/traits.rs18
1 files changed, 16 insertions, 2 deletions
diff --git a/crates/ra_syntax/src/grammar/items/traits.rs b/crates/ra_syntax/src/grammar/items/traits.rs
index c21cfb1a9..5dfdb470c 100644
--- a/crates/ra_syntax/src/grammar/items/traits.rs
+++ b/crates/ra_syntax/src/grammar/items/traits.rs
@@ -55,9 +55,9 @@ pub(super) fn impl_item(p: &mut Parser) {
55 // test impl_item_neg 55 // test impl_item_neg
56 // impl !Send for X {} 56 // impl !Send for X {}
57 p.eat(EXCL); 57 p.eat(EXCL);
58 types::type_(p); 58 impl_type(p);
59 if p.eat(FOR_KW) { 59 if p.eat(FOR_KW) {
60 types::type_(p); 60 impl_type(p);
61 } 61 }
62 type_params::opt_where_clause(p); 62 type_params::opt_where_clause(p);
63 if p.at(L_CURLY) { 63 if p.at(L_CURLY) {
@@ -115,3 +115,17 @@ fn choose_type_params_over_qpath(p: &Parser) -> bool {
115 (p.nth(1) == LIFETIME || p.nth(1) == IDENT) 115 (p.nth(1) == LIFETIME || p.nth(1) == IDENT)
116 && (p.nth(2) == R_ANGLE || p.nth(2) == COMMA || p.nth(2) == COLON || p.nth(2) == EQ) 116 && (p.nth(2) == R_ANGLE || p.nth(2) == COMMA || p.nth(2) == COLON || p.nth(2) == EQ)
117} 117}
118
119// test impl_type
120// impl Type {}
121// impl Trait1 for T {}
122// impl impl NotType {}
123// impl Trait2 for impl NotType {}
124pub(crate) fn impl_type(p: &mut Parser) {
125 if p.at(IMPL_KW) {
126 p.error("expected trait or type");
127 return;
128 }
129 types::type_(p);
130}
131