Rollup merge of #141094 - satler-git:issue-101650, r=lcnr

add regression test for rust-lang#101650

closes #101650, which was already fixed.
This commit is contained in:
Stuart Cook 2025-05-19 13:24:54 +10:00 committed by GitHub
commit d5e59b8a38
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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() {}