diff options
| author | Takayuki Maeda <takoyaki0316@gmail.com> | 2022-09-07 03:59:47 +0900 |
|---|---|---|
| committer | Takayuki Maeda <takoyaki0316@gmail.com> | 2022-09-07 03:59:47 +0900 |
| commit | 7ac124803f696b7e28d9fdae2f676093024de378 (patch) | |
| tree | ec30f677efd9760f6048dae8a0392c7d308aa87b /compiler/rustc_parse | |
| parent | b44197abb0b3ffe4908892e1e08ab1cd721ff3b9 (diff) | |
| download | rust-7ac124803f696b7e28d9fdae2f676093024de378.tar.gz rust-7ac124803f696b7e28d9fdae2f676093024de378.zip | |
do not suggest a semicolon for a macro without `!`
Diffstat (limited to 'compiler/rustc_parse')
| -rw-r--r-- | compiler/rustc_parse/src/parser/expr.rs | 3 |
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 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( |
