add regression test for rust-lang#101650

This commit is contained in:
satler 2025-05-17 01:09:02 +09:00
parent 1b9efcd18f
commit 067fe1ffb5
No known key found for this signature in database
GPG key ID: 1DB0252A735D5BAC

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