about summary refs log tree commit diff
diff options
context:
space:
mode:
authorStuart Cook <Zalathar@users.noreply.github.com>2025-05-19 13:24:54 +1000
committerGitHub <noreply@github.com>2025-05-19 13:24:54 +1000
commitd5e59b8a382e7dfcaa6d3d9663fd7d58166352ce (patch)
tree761f9869c2bcd700237c6ed468901518c6fefcfc
parent599b08ada818de617fc565d3aa3afff3a210bb4d (diff)
parent067fe1ffb5789ff2cfdb3d01f756e48911c48063 (diff)
downloadrust-d5e59b8a382e7dfcaa6d3d9663fd7d58166352ce.tar.gz
rust-d5e59b8a382e7dfcaa6d3d9663fd7d58166352ce.zip
Rollup merge of #141094 - satler-git:issue-101650, r=lcnr
add regression test for rust-lang#101650

closes #101650, which was already fixed.
-rw-r--r--tests/ui/async-await/format-await-send.rs24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/ui/async-await/format-await-send.rs b/tests/ui/async-await/format-await-send.rs
new file mode 100644
index 00000000000..13ae7233fd6
--- /dev/null
+++ b/tests/ui/async-await/format-await-send.rs
@@ -0,0 +1,24 @@
+// regression test for <https://github.com/rust-lang/rust/issues/101650>
+// assert that Future which has format!() with an async function is Send
+
+#![allow(unused)]
+
+//@ check-pass
+//@ edition: 2018
+
+use core::future::Future;
+use core::pin::Pin;
+
+fn build_string() -> Pin<Box<dyn Future<Output = String> + Send>> {
+    Box::pin(async move {
+        let mut string_builder = String::new();
+        string_builder += &format!("Hello {}", helper().await);
+        string_builder
+    })
+}
+
+async fn helper() -> String {
+    "World".to_string()
+}
+
+fn main() {}