about summary refs log tree commit diff
path: root/src/tools/rustfmt/tests/source/issue-3665
diff options
context:
space:
mode:
authorCaleb Cartwright <caleb.cartwright@outlook.com>2021-05-14 21:53:36 -0500
committerCaleb Cartwright <caleb.cartwright@outlook.com>2021-05-14 21:53:36 -0500
commitb2d45c0d4b2d44789000ebec6d702cc27db19782 (patch)
treec3accc00616767e5de0f89f69ce87519f02de6d5 /src/tools/rustfmt/tests/source/issue-3665
parente659b6de9170c055b6f2d16e2679b22d67297b13 (diff)
parent7872306edf2e11a69aaffb9434088fd66b46a863 (diff)
Add 'src/tools/rustfmt/' from commit '7872306edf2e11a69aaffb9434088fd66b46a863'
git-subtree-dir: src/tools/rustfmt
git-subtree-mainline: e659b6de9170c055b6f2d16e2679b22d67297b13
git-subtree-split: 7872306edf2e11a69aaffb9434088fd66b46a863
Diffstat (limited to 'src/tools/rustfmt/tests/source/issue-3665')
-rw-r--r--src/tools/rustfmt/tests/source/issue-3665/lib.rs33
-rw-r--r--src/tools/rustfmt/tests/source/issue-3665/not_skip_attribute.rs4
-rw-r--r--src/tools/rustfmt/tests/source/issue-3665/sub_mod.rs14
3 files changed, 51 insertions, 0 deletions
diff --git a/src/tools/rustfmt/tests/source/issue-3665/lib.rs b/src/tools/rustfmt/tests/source/issue-3665/lib.rs
new file mode 100644
index 00000000000..e049fbc5680
--- /dev/null
+++ b/src/tools/rustfmt/tests/source/issue-3665/lib.rs
@@ -0,0 +1,33 @@
+#![rustfmt::skip::attributes(skip_mod_attr)]
+
+mod sub_mod;
+
+#[rustfmt::skip::attributes(other, skip_attr)]
+fn main() {
+    #[other(should,
+skip,
+        this,                               format)]
+    struct S {}
+
+    #[skip_attr(should, skip,
+this,                               format,too)]
+    fn doesnt_mater() {}
+
+    #[skip_mod_attr(should, skip,
+this,                               format,
+         enerywhere)]
+    fn more() {}
+
+    #[not_skip(not,
+skip,    me)]
+    struct B {}
+}
+
+#[other(should, not, skip,
+this,                               format, here)]
+fn foo() {}
+
+#[skip_mod_attr(should, skip,
+this,                               format,in,                    master,
+                    and, sub, module)]
+fn bar() {}
diff --git a/src/tools/rustfmt/tests/source/issue-3665/not_skip_attribute.rs b/src/tools/rustfmt/tests/source/issue-3665/not_skip_attribute.rs
new file mode 100644
index 00000000000..14985259a50
--- /dev/null
+++ b/src/tools/rustfmt/tests/source/issue-3665/not_skip_attribute.rs
@@ -0,0 +1,4 @@
+#![this::is::not::skip::attribute(ouch)]
+
+#[ouch(not,      skip,  me)]
+fn main() {}
diff --git a/src/tools/rustfmt/tests/source/issue-3665/sub_mod.rs b/src/tools/rustfmt/tests/source/issue-3665/sub_mod.rs
new file mode 100644
index 00000000000..75fb24b4a65
--- /dev/null
+++ b/src/tools/rustfmt/tests/source/issue-3665/sub_mod.rs
@@ -0,0 +1,14 @@
+#[rustfmt::skip::attributes(more_skip)]
+#[more_skip(should,
+      skip,
+this,                               format)]
+fn foo() {}
+
+#[skip_mod_attr(should, skip,
+this,                               format,in,                    master,
+                    and, sub, module)]
+fn bar() {}
+
+#[skip_attr(should,  not,
+  skip,      this, attribute,    here)]
+fn baz() {}