diff options
| author | Stuart Cook <Zalathar@users.noreply.github.com> | 2025-05-19 13:24:54 +1000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-05-19 13:24:54 +1000 |
| commit | d5e59b8a382e7dfcaa6d3d9663fd7d58166352ce (patch) | |
| tree | 761f9869c2bcd700237c6ed468901518c6fefcfc | |
| parent | 599b08ada818de617fc565d3aa3afff3a210bb4d (diff) | |
| parent | 067fe1ffb5789ff2cfdb3d01f756e48911c48063 (diff) | |
| download | rust-d5e59b8a382e7dfcaa6d3d9663fd7d58166352ce.tar.gz rust-d5e59b8a382e7dfcaa6d3d9663fd7d58166352ce.zip | |
Rollup merge of #141094 - satler-git:issue-101650, r=lcnr
add regression test for rust-lang#101650 closes #101650, which was already fixed.
| -rw-r--r-- | tests/ui/async-await/format-await-send.rs | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/ui/async-await/format-await-send.rs b/tests/ui/async-await/format-await-send.rs new file mode 100644 index 00000000000..13ae7233fd6 --- /dev/null +++ b/tests/ui/async-await/format-await-send.rs @@ -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() {} |
