about summary refs log tree commit diff
path: root/compiler/rustc_parse/src
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2022-09-07 21:48:15 +0200
committerGitHub <noreply@github.com>2022-09-07 21:48:15 +0200
commitc365ce3ffddd05d85c55bdbcdb30a1106baf6072 (patch)
tree6b08622e552d20d584f14676b6c80841d495185e /compiler/rustc_parse/src
parent9361297dfcc3ec1c2efe4cc71ef89009a1991232 (diff)
parent7ac124803f696b7e28d9fdae2f676093024de378 (diff)
downloadrust-c365ce3ffddd05d85c55bdbcdb30a1106baf6072.tar.gz
rust-c365ce3ffddd05d85c55bdbcdb30a1106baf6072.zip
Rollup merge of #101502 - TaKO8Ki:do-not-suggest-semicolon-for-macro-without-exclamation-mark, r=wesleywiser
Do not suggest a semicolon for a macro without `!`

Fixes a regression in #101490
Diffstat (limited to 'compiler/rustc_parse/src')
-rw-r--r--compiler/rustc_parse/src/parser/expr.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/compiler/rustc_parse/src/parser/expr.rs b/compiler/rustc_parse/src/parser/expr.rs
index 7addf519872..ed37ede65d5 100644
--- a/compiler/rustc_parse/src/parser/expr.rs
+++ b/compiler/rustc_parse/src/parser/expr.rs
@@ -1977,6 +1977,9 @@ impl<'a> Parser<'a> {
         open_delim_span: Span,
     ) -> PResult<'a, ()> {
         if self.token.kind == token::Comma {
+            if !self.sess.source_map().is_multiline(prev_span.until(self.token.span)) {
+                return Ok(());
+            }
             let mut snapshot = self.create_snapshot_for_diagnostic();
             snapshot.bump();
             match snapshot.parse_seq_to_before_end(