Skip to content

Commit d5e59b8

Browse files
authored
Rollup merge of #141094 - satler-git:issue-101650, r=lcnr
add regression test for #101650 closes #101650, which was already fixed.
2 parents 599b08a + 067fe1f commit d5e59b8

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)