diff options
| author | Michael Goulet <michael@errs.io> | 2022-07-02 03:04:18 +0000 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2022-07-23 17:52:45 +0000 |
| commit | 9d5c74e16ae4bca9efb0fbc5c4818200ea8b5980 (patch) | |
| tree | 0f51206500ce0357664a22ef44d3026bcac238bd /compiler/rustc_parse/src | |
| parent | e55c53c57e953a4f5716461dbaf4af5d623d80da (diff) | |
| download | rust-9d5c74e16ae4bca9efb0fbc5c4818200ea8b5980.tar.gz rust-9d5c74e16ae4bca9efb0fbc5c4818200ea8b5980.zip | |
Do not suggest adding `;` when `,` is also a choice
Diffstat (limited to 'compiler/rustc_parse/src')
| -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 63055c56c5c..f9ca10375e6 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: // |
