about summary refs log tree commit diff
path: root/src/tools/rustfmt/tests/source
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2021-12-30 20:53:39 +0000
committerbors <bors@rust-lang.org>2021-12-30 20:53:39 +0000
commita09f775e5a71ba809f465b3af377943627552001 (patch)
tree5aafb762c9cf254fe4a9c10cc47570a1079d58cd /src/tools/rustfmt/tests/source
parentb60e32c82864d841e87359333af1e6d1f9cff9ee (diff)
parent521fdcbe4ddaa717be2acbeb30f8978d6378fea1 (diff)
downloadrust-a09f775e5a71ba809f465b3af377943627552001.tar.gz
rust-a09f775e5a71ba809f465b3af377943627552001.zip
Auto merge of #92426 - calebcartwright:sync-rustfmt-subtree, r=calebcartwright
Sync rustfmt subtree

r? `@ghost`

Mostly refactoring and a few minor lint fixes, along with a couple small bug fixes
Diffstat (limited to 'src/tools/rustfmt/tests/source')
-rw-r--r--src/tools/rustfmt/tests/source/async_block.rs16
-rw-r--r--src/tools/rustfmt/tests/source/match.rs19
2 files changed, 35 insertions, 0 deletions
diff --git a/src/tools/rustfmt/tests/source/async_block.rs b/src/tools/rustfmt/tests/source/async_block.rs
index 3de51a084d2..18cb4fb5f5c 100644
--- a/src/tools/rustfmt/tests/source/async_block.rs
+++ b/src/tools/rustfmt/tests/source/async_block.rs
@@ -32,4 +32,20 @@ fn baz() {
             Ok(())
         },
     );
+
+    spawn(
+        a,
+        static async || {
+            action();
+            Ok(())
+        },
+    );
+
+    spawn(
+        a,
+        static async move || {
+            action();
+            Ok(())
+        },
+    );
 }
diff --git a/src/tools/rustfmt/tests/source/match.rs b/src/tools/rustfmt/tests/source/match.rs
index da20517203a..b5dc9957a2c 100644
--- a/src/tools/rustfmt/tests/source/match.rs
+++ b/src/tools/rustfmt/tests/source/match.rs
@@ -568,3 +568,22 @@ fn issue_3774() {
         }
     }
 }
+
+// #4109
+fn issue_4109() {
+    match () {
+        _ => {
+#[cfg(debug_assertions)]
+{
+println!("Foo");
+}
+}
+}
+
+match () {
+_ => {
+#[allow(unsafe_code)]
+unsafe {}
+}
+}
+}