diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2022-08-04 22:24:59 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-08-04 22:24:59 +0200 |
| commit | f6ea143f939934e2c3a6068feff4bd066cc19ff4 (patch) | |
| tree | a040cd4dae8a569d2cf143e438917749ea1319b8 /compiler/rustc_parse/src/parser/diagnostics.rs | |
| parent | 3830ecaa8db798d2727cbdfa4ddf314ff938f268 (diff) | |
| parent | 9d5c74e16ae4bca9efb0fbc5c4818200ea8b5980 (diff) | |
| download | rust-f6ea143f939934e2c3a6068feff4bd066cc19ff4.tar.gz rust-f6ea143f939934e2c3a6068feff4bd066cc19ff4.zip | |
Rollup merge of #98796 - compiler-errors:no-semi-if-comma, r=estebank
Do not exclusively suggest `;` when `,` is also a choice Fixes #96791
Diffstat (limited to 'compiler/rustc_parse/src/parser/diagnostics.rs')
| -rw-r--r-- | compiler/rustc_parse/src/parser/diagnostics.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/rustc_parse/src/parser/diagnostics.rs b/compiler/rustc_parse/src/parser/diagnostics.rs index 09329f18c67..a2155ac1d1a 100644 --- a/compiler/rustc_parse/src/parser/diagnostics.rs +++ b/compiler/rustc_parse/src/parser/diagnostics.rs @@ -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: // |
