1
Fork 0

Rollup merge of #98796 - compiler-errors:no-semi-if-comma, r=estebank

Do not exclusively suggest `;` when `,` is also a choice

Fixes #96791
This commit is contained in:
Matthias Krüger 2022-08-04 22:24:59 +02:00 committed by GitHub
commit f6ea143f93
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 23 additions and 13 deletions

View file

@ -560,7 +560,8 @@ impl<'a> Parser<'a> {
|| (sm.is_multiline(
self.prev_token.span.shrink_to_hi().until(self.token.span.shrink_to_lo())
) && t == &token::Pound)
}) {
}) && !expected.contains(&TokenType::Token(token::Comma))
{
// Missing semicolon typo. This is triggered if the next token could either start a
// new statement or is a block close. For example:
//