diff --git a/crates/ra_syntax/src/grammar/items/traits.rs b/crates/ra_syntax/src/grammar/items/traits.rs index c21cfb1a9b4e..25b6cb66b3d2 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); }