1
Fork 0

Fix condition for "missing struct" diagnostic on tuple structs

The check previously matched this, and suggested adding a missing
`struct`:

pub Foo(...):

It was probably intended to match this instead (semicolon instead of
colon):

pub Foo(...);
This commit is contained in:
Xiretza 2022-10-06 18:35:53 +02:00
parent a84adba552
commit 0757d5f83f
8 changed files with 42 additions and 7 deletions

View file

@ -412,7 +412,7 @@ impl<'a> Parser<'a> {
} else if self.check(&token::OpenDelim(Delimiter::Brace)) {
self.bump(); // `{`
("fn", kw_name, false)
} else if self.check(&token::Colon) {
} else if self.check(&token::Semi) {
let kw = "struct";
(kw, kw, false)
} else {