diff options
author | csmoe <[email protected]> | 2018-09-24 04:42:01 +0100 |
---|---|---|
committer | csmoe <[email protected]> | 2018-09-24 04:44:43 +0100 |
commit | cacb32d88aa27b8e671173571325756890941b06 (patch) | |
tree | ddb83902ba9bb99b14dc9f410898f31873ae76ac /crates | |
parent | e4463165854071e16645a3244e016b45752e68b7 (diff) |
reject impl keyword in impl header
Diffstat (limited to 'crates')
-rw-r--r-- | crates/ra_syntax/src/grammar/items/traits.rs | 12 |
1 files changed, 10 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..25b6cb66b 100644 --- a/crates/ra_syntax/src/grammar/items/traits.rs +++ b/crates/ra_syntax/src/grammar/items/traits.rs | |||
@@ -54,8 +54,16 @@ pub(super) fn impl_item(p: &mut Parser) { | |||
54 | 54 | ||
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 | if p.at(IMPL_KW) { |
58 | types::type_(p); | 58 | p.error("expected type"); |
59 | } else { | ||
60 | p.eat(EXCL); | ||
61 | if p.at(IMPL_KW) { | ||
62 | p.error("expected type"); | ||
63 | } else { | ||
64 | types::type_(p); | ||
65 | } | ||
66 | } | ||
59 | if p.eat(FOR_KW) { | 67 | if p.eat(FOR_KW) { |
60 | types::type_(p); | 68 | types::type_(p); |
61 | } | 69 | } |