2024-02-14 18:00:00 -06:00
|
|
|
// Regression test for #121094.
|
2024-02-16 14:02:50 -06:00
|
|
|
//@ build-pass
|
|
|
|
//@ compile-flags: -O --crate-type=lib
|
|
|
|
//@ edition: 2021
|
2024-02-14 18:00:00 -06:00
|
|
|
use std::{future::Future, pin::Pin};
|
|
|
|
|
|
|
|
pub async fn foo(count: u32) {
|
|
|
|
if count == 0 {
|
|
|
|
return
|
|
|
|
} else {
|
|
|
|
let fut: Pin<Box<dyn Future<Output = ()>>> = Box::pin(foo(count - 1));
|
|
|
|
fut.await;
|
|
|
|
}
|
|
|
|
}
|