mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-26 13:03:31 +00:00
reject impl keyword in impl header
This commit is contained in:
parent
e446316585
commit
cacb32d88a
1 changed files with 10 additions and 2 deletions
|
@ -54,8 +54,16 @@ pub(super) fn impl_item(p: &mut Parser) {
|
||||||
|
|
||||||
// test impl_item_neg
|
// test impl_item_neg
|
||||||
// impl !Send for X {}
|
// impl !Send for X {}
|
||||||
p.eat(EXCL);
|
if p.at(IMPL_KW) {
|
||||||
types::type_(p);
|
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) {
|
if p.eat(FOR_KW) {
|
||||||
types::type_(p);
|
types::type_(p);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue