summary refs log tree commit diff
path: root/src/tools/rustfmt/tests/source/issue-4984
diff options
context:
space:
mode:
authorCaleb Cartwright <caleb.cartwright@outlook.com>2021-10-20 00:11:59 -0500
committerCaleb Cartwright <caleb.cartwright@outlook.com>2021-10-20 00:11:59 -0500
commit714e904969b6ac7c8da446122952e154fd2e8ea7 (patch)
tree77c9b0d05b4eaa6dec0e9223efc99cda38505048 /src/tools/rustfmt/tests/source/issue-4984
parent42983a28ab3c70728da7a9b932b667c978dd898d (diff)
parentefa8f5521d3813cc897ba29ea0ef98c7aef66bb6 (diff)
downloadrust-714e904969b6ac7c8da446122952e154fd2e8ea7.tar.gz
rust-714e904969b6ac7c8da446122952e154fd2e8ea7.zip
Merge commit 'efa8f5521d3813cc897ba29ea0ef98c7aef66bb6' into rustfmt-subtree
Diffstat (limited to 'src/tools/rustfmt/tests/source/issue-4984')
-rw-r--r--src/tools/rustfmt/tests/source/issue-4984/minimum_example.rs2
-rw-r--r--src/tools/rustfmt/tests/source/issue-4984/multi_line_derive.rs20
-rw-r--r--src/tools/rustfmt/tests/source/issue-4984/multiple_comments_within.rs8
3 files changed, 30 insertions, 0 deletions
diff --git a/src/tools/rustfmt/tests/source/issue-4984/minimum_example.rs b/src/tools/rustfmt/tests/source/issue-4984/minimum_example.rs
new file mode 100644
index 00000000000..677f8737716
--- /dev/null
+++ b/src/tools/rustfmt/tests/source/issue-4984/minimum_example.rs
@@ -0,0 +1,2 @@
+#[derive(/*Debug, */Clone)]
+struct Foo;
diff --git a/src/tools/rustfmt/tests/source/issue-4984/multi_line_derive.rs b/src/tools/rustfmt/tests/source/issue-4984/multi_line_derive.rs
new file mode 100644
index 00000000000..73921dd1735
--- /dev/null
+++ b/src/tools/rustfmt/tests/source/issue-4984/multi_line_derive.rs
@@ -0,0 +1,20 @@
+#[derive(
+/* ---------- Some really important comment that just had to go inside the derive --------- */
+Debug, Clone, Eq, PartialEq,
+)]
+struct Foo {
+    a: i32,
+    b: T,
+}
+
+#[derive(
+/*
+    Some really important comment that just had to go inside the derive.
+    Also had to be put over multiple lines
+*/
+Debug, Clone, Eq, PartialEq,
+)]
+struct Bar {
+    a: i32,
+    b: T,
+}
diff --git a/src/tools/rustfmt/tests/source/issue-4984/multiple_comments_within.rs b/src/tools/rustfmt/tests/source/issue-4984/multiple_comments_within.rs
new file mode 100644
index 00000000000..eb474a723d0
--- /dev/null
+++ b/src/tools/rustfmt/tests/source/issue-4984/multiple_comments_within.rs
@@ -0,0 +1,8 @@
+#[derive(
+/* ---------- Some really important comment that just had to go inside the derive --------- */
+Debug, Clone,/* Another comment */Eq, PartialEq,
+)]
+struct Foo {
+    a: i32,
+    b: T,
+}