From 7ac124803f696b7e28d9fdae2f676093024de378 Mon Sep 17 00:00:00 2001 From: Takayuki Maeda Date: Wed, 7 Sep 2022 03:59:47 +0900 Subject: do not suggest a semicolon for a macro without `!` --- compiler/rustc_parse/src/parser/expr.rs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'compiler/rustc_parse') diff --git a/compiler/rustc_parse/src/parser/expr.rs b/compiler/rustc_parse/src/parser/expr.rs index d4828a20120..10cd353062e 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( -- cgit 1.4.1-3-g733a5