mirror of
https://github.com/rust-lang/rust.git
synced 2025-06-21 03:57:38 +00:00
25 lines
556 B
Rust
25 lines
556 B
Rust
// 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() {}
|