reject impl keyword in impl header

This commit is contained in:
csmoe 2018-09-24 11:42:01 +08:00
parent e446316585
commit cacb32d88a

View file

@ -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);
} }