Skip to content

Commit 374dba8

Browse files
authored
Merge pull request rust-lang#2552 from alanhdu/master
Close rust-lang#2551
2 parents ff9ab51 + d402cd2 commit 374dba8

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

src/expr.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1547,7 +1547,7 @@ pub fn span_ends_with_comma(context: &RewriteContext, span: Span) -> bool {
15471547
for (kind, c) in CharClasses::new(context.snippet(span).chars()) {
15481548
match c {
15491549
_ if kind.is_comment() || c.is_whitespace() => continue,
1550-
')' | '}' => result = result && prev_char != c,
1550+
')' | '}' => result = result && prev_char != ')' && prev_char != '}',
15511551
',' => result = true,
15521552
_ => result = false,
15531553
}

src/matches.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
use std::iter::repeat;
1414

1515
use config::lists::*;
16-
use syntax::{ast, ptr};
1716
use syntax::codemap::{BytePos, Span};
17+
use syntax::{ast, ptr};
1818

1919
use codemap::SpanUtils;
2020
use comment::combine_strs_with_missing_comments;

tests/target/issue-2551.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
mcro!(func(A {
2+
a: 12345667800111111111111,
3+
}));

0 commit comments

Comments
 (0)