We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 599b08a + 067fe1f commit d5e59b8Copy full SHA for d5e59b8
tests/ui/async-await/format-await-send.rs
@@ -0,0 +1,24 @@
1
+// regression test for <https://github.com/rust-lang/rust/issues/101650>
2
+// assert that Future which has format!() with an async function is Send
3
+
4
+#![allow(unused)]
5
6
+//@ check-pass
7
+//@ edition: 2018
8
9
+use core::future::Future;
10
+use core::pin::Pin;
11
12
+fn build_string() -> Pin<Box<dyn Future<Output = String> + Send>> {
13
+ Box::pin(async move {
14
+ let mut string_builder = String::new();
15
+ string_builder += &format!("Hello {}", helper().await);
16
+ string_builder
17
+ })
18
+}
19
20
+async fn helper() -> String {
21
+ "World".to_string()
22
23
24
+fn main() {}
0 commit comments