-
Notifications
You must be signed in to change notification settings - Fork 898
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed Issue 'Trailing comma is duplicated when obstructed by comments' (
#4520) * Fixed Issue 'Trailing comma is duplicated when obstructed by comments' * Put separator at the begining of the post comment * Removed accidentally pushed tmp file * Add test cases for #4714 * Avoid ownership issue by a tricky way and added test cases for block comments * Fixed tests
- Loading branch information
Showing
5 changed files
with
126 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
fn f<S>(s: S) | ||
where | ||
S: Send /* */, | ||
// | ||
{ | ||
} | ||
|
||
fn main() { | ||
foo( | ||
x | ||
// comment 1 | ||
, | ||
// comment 2 | ||
) | ||
} | ||
|
||
fn main() { | ||
foo( | ||
x | ||
// comment 1 | ||
|
||
|
||
, | ||
|
||
|
||
|
||
// comment 2 | ||
) | ||
} | ||
|
||
fn main() { | ||
foo( | ||
x | ||
/* Comment 1 */ | ||
, | ||
/* Comment 2 */ | ||
) | ||
} | ||
|
||
fn main() { | ||
foo( | ||
x /* Comment 1 */ , /* Comment 2 */ | ||
) | ||
} | ||
|
||
fn main() { | ||
foo( | ||
x | ||
/* comment 1 */ | ||
|
||
|
||
, | ||
|
||
|
||
|
||
/* comment 2 */ | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
struct Something { | ||
field: u32/*a*/,/*b*/ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
fn f<S>(s: S) | ||
where | ||
S: Send, /* */ | ||
// | ||
{ | ||
} | ||
|
||
fn main() { | ||
foo( | ||
x, // comment 1 | ||
// comment 2 | ||
) | ||
} | ||
|
||
fn main() { | ||
foo( | ||
x, // comment 1 | ||
// comment 2 | ||
) | ||
} | ||
|
||
fn main() { | ||
foo( | ||
x, /* Comment 1 */ | ||
/* Comment 2 */ | ||
) | ||
} | ||
|
||
fn main() { | ||
foo( | ||
x, /* Comment 1 */ | ||
/* Comment 2 */ | ||
) | ||
} | ||
|
||
fn main() { | ||
foo( | ||
x, /* comment 1 */ | ||
/* comment 2 */ | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
struct Something { | ||
field: u32, /*a*/ | ||
/*b*/ | ||
} |