forked from rust-lang/rustfmt
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request rust-lang#3415 from rchaser53/issue-3198
fix the comment for self are swallowed
- Loading branch information
Showing
4 changed files
with
213 additions
and
24 deletions.
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
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,99 @@ | ||
impl TestTrait { | ||
fn foo_one_pre(/* Important comment1 */ | ||
self) { | ||
} | ||
|
||
fn foo_one_post(self | ||
/* Important comment1 */) { | ||
} | ||
|
||
fn foo_pre( | ||
/* Important comment1 */ | ||
self, | ||
/* Important comment2 */ | ||
a: i32, | ||
) { | ||
} | ||
|
||
fn foo_post( | ||
self | ||
/* Important comment1 */, | ||
a: i32 | ||
/* Important comment2 */, | ||
) { | ||
} | ||
|
||
fn bar_pre( | ||
/* Important comment1 */ | ||
&mut self, | ||
/* Important comment2 */ | ||
a: i32, | ||
) { | ||
} | ||
|
||
fn bar_post( | ||
&mut self | ||
/* Important comment1 */, | ||
a: i32 | ||
/* Important comment2 */, | ||
) { | ||
} | ||
|
||
fn baz_pre( | ||
/* Important comment1 */ | ||
self: X< 'a , 'b >, | ||
/* Important comment2 */ | ||
a: i32, | ||
) { | ||
} | ||
|
||
fn baz_post( | ||
self: X< 'a , 'b > | ||
/* Important comment1 */, | ||
a: i32 | ||
/* Important comment2 */, | ||
) { | ||
} | ||
|
||
fn baz_tree_pre( | ||
/* Important comment1 */ | ||
self: X< 'a , 'b >, | ||
/* Important comment2 */ | ||
a: i32, | ||
/* Important comment3 */ | ||
b: i32, | ||
) { | ||
} | ||
|
||
fn baz_tree_post( | ||
self: X< 'a , 'b > | ||
/* Important comment1 */, | ||
a: i32 | ||
/* Important comment2 */, | ||
b: i32 | ||
/* Important comment3 */,){ | ||
} | ||
|
||
fn multi_line( | ||
self: X<'a, 'b>, /* Important comment1-1 */ | ||
/* Important comment1-2 */ | ||
a: i32, /* Important comment2 */ | ||
b: i32, /* Important comment3 */ | ||
) { | ||
} | ||
|
||
fn two_line_comment( | ||
self: X<'a, 'b>, /* Important comment1-1 | ||
Important comment1-2 */ | ||
a: i32, /* Important comment2 */ | ||
b: i32, /* Important comment3 */ | ||
) { | ||
} | ||
|
||
fn no_first_line_comment( | ||
self: X<'a, 'b>, | ||
/* Important comment2 */a: i32, | ||
/* Important comment3 */b: i32, | ||
) { | ||
} | ||
} |
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,67 @@ | ||
impl TestTrait { | ||
fn foo_one_pre(/* Important comment1 */ self) {} | ||
|
||
fn foo_one_post(self /* Important comment1 */) {} | ||
|
||
fn foo_pre(/* Important comment1 */ self, /* Important comment2 */ a: i32) {} | ||
|
||
fn foo_post(self /* Important comment1 */, a: i32 /* Important comment2 */) {} | ||
|
||
fn bar_pre(/* Important comment1 */ &mut self, /* Important comment2 */ a: i32) {} | ||
|
||
fn bar_post(&mut self /* Important comment1 */, a: i32 /* Important comment2 */) {} | ||
|
||
fn baz_pre( | ||
/* Important comment1 */ | ||
self: X<'a, 'b>, | ||
/* Important comment2 */ | ||
a: i32, | ||
) { | ||
} | ||
|
||
fn baz_post( | ||
self: X<'a, 'b>, /* Important comment1 */ | ||
a: i32, /* Important comment2 */ | ||
) { | ||
} | ||
|
||
fn baz_tree_pre( | ||
/* Important comment1 */ | ||
self: X<'a, 'b>, | ||
/* Important comment2 */ | ||
a: i32, | ||
/* Important comment3 */ | ||
b: i32, | ||
) { | ||
} | ||
|
||
fn baz_tree_post( | ||
self: X<'a, 'b>, /* Important comment1 */ | ||
a: i32, /* Important comment2 */ | ||
b: i32, /* Important comment3 */ | ||
) { | ||
} | ||
|
||
fn multi_line( | ||
self: X<'a, 'b>, /* Important comment1-1 */ | ||
/* Important comment1-2 */ | ||
a: i32, /* Important comment2 */ | ||
b: i32, /* Important comment3 */ | ||
) { | ||
} | ||
|
||
fn two_line_comment( | ||
self: X<'a, 'b>, /* Important comment1-1 | ||
Important comment1-2 */ | ||
a: i32, /* Important comment2 */ | ||
b: i32, /* Important comment3 */ | ||
) { | ||
} | ||
|
||
fn no_first_line_comment( | ||
self: X<'a, 'b>, | ||
/* Important comment2 */ a: i32, | ||
/* Important comment3 */ b: i32, | ||
) { | ||
} | ||
} |