summaryrefslogtreecommitdiffstats
path: root/src/tools/rustfmt/tests/source/issue-3198.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:02:58 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:02:58 +0000
commit698f8c2f01ea549d77d7dc3338a12e04c11057b9 (patch)
tree173a775858bd501c378080a10dca74132f05bc50 /src/tools/rustfmt/tests/source/issue-3198.rs
parentInitial commit. (diff)
downloadrustc-698f8c2f01ea549d77d7dc3338a12e04c11057b9.tar.xz
rustc-698f8c2f01ea549d77d7dc3338a12e04c11057b9.zip
Adding upstream version 1.64.0+dfsg1.upstream/1.64.0+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/tools/rustfmt/tests/source/issue-3198.rs')
-rw-r--r--src/tools/rustfmt/tests/source/issue-3198.rs99
1 files changed, 99 insertions, 0 deletions
diff --git a/src/tools/rustfmt/tests/source/issue-3198.rs b/src/tools/rustfmt/tests/source/issue-3198.rs
new file mode 100644
index 000000000..48cb24a00
--- /dev/null
+++ b/src/tools/rustfmt/tests/source/issue-3198.rs
@@ -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,
+ ) {
+ }
+}