diff options
| author | bors <bors@rust-lang.org> | 2025-05-19 05:40:16 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2025-05-19 05:40:16 +0000 |
| commit | 5f292eea6d63abbd26f1e6e00a0b8cf21d828d7d (patch) | |
| tree | 9ad151f0444fe3885af08319262b235b40292f6a /tests/ui | |
| parent | e42bbfe1f7c26f8760a99c4b1f27d33aba1040bb (diff) | |
| parent | 93bc64dd49eb261306d54b7507e652ff94bd76fc (diff) | |
| download | rust-5f292eea6d63abbd26f1e6e00a0b8cf21d828d7d.tar.gz rust-5f292eea6d63abbd26f1e6e00a0b8cf21d828d7d.zip | |
Auto merge of #141238 - Zalathar:rollup-zdqpazo, r=Zalathar
Rollup of 4 pull requests Successful merges: - #140049 (fix autodiff macro on generic functions) - #140874 (make `rustc_attr_parsing` less dominant in the rustc crate graph) - #141094 (add regression test for rust-lang#101650) - #141110 ([std] fix the presentation of `split_off_mut` and `split_off` documentation) r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'tests/ui')
| -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() {} |
