From cacb32d88aa27b8e671173571325756890941b06 Mon Sep 17 00:00:00 2001 From: csmoe <35686186+csmoe@users.noreply.github.com> Date: Mon, 24 Sep 2018 11:42:01 +0800 Subject: reject impl keyword in impl header --- crates/ra_syntax/src/grammar/items/traits.rs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'crates/ra_syntax') 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) { // test impl_item_neg // impl !Send for X {} - p.eat(EXCL); - types::type_(p); + if p.at(IMPL_KW) { + p.error("expected type"); + } else { + p.eat(EXCL); + if p.at(IMPL_KW) { + p.error("expected type"); + } else { + types::type_(p); + } + } if p.eat(FOR_KW) { types::type_(p); } -- cgit v1.2.3