From 4f9fe856a25ab29345b90e7725509e9ee38a37be Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:19:41 +0200 Subject: Adding upstream version 1.69.0+dfsg1. Signed-off-by: Daniel Baumann --- .../async-await/future-sizes/async-awaiting-fut.rs | 24 ++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 tests/ui/async-await/future-sizes/async-awaiting-fut.rs (limited to 'tests/ui/async-await/future-sizes/async-awaiting-fut.rs') diff --git a/tests/ui/async-await/future-sizes/async-awaiting-fut.rs b/tests/ui/async-await/future-sizes/async-awaiting-fut.rs new file mode 100644 index 000000000..1816d842d --- /dev/null +++ b/tests/ui/async-await/future-sizes/async-awaiting-fut.rs @@ -0,0 +1,24 @@ +// compile-flags: -Z print-type-sizes --crate-type lib +// edition:2021 +// build-pass +// ignore-pass + +async fn wait() {} + +async fn big_fut(arg: [u8; 1024]) {} + +async fn calls_fut(fut: impl std::future::Future) { + loop { + wait().await; + if true { + return fut.await; + } else { + wait().await; + } + } +} + +pub async fn test() { + let fut = big_fut([0u8; 1024]); + calls_fut(fut).await; +} -- cgit v1.2.3