Files
rust/tests/ui/dataflow_const_prop/recursive-async.rs
T
Ben Kimock 4b1f3926de Avoid query cycles in DataflowConstProp
* Avoid query cycles in DataflowConstProp
* Add -Zmir-opt-level=0 to the test
2026-04-24 03:04:03 +00:00

12 lines
303 B
Rust

//! Ensure DataflowConstProp doesn't cause an error with async recursion as in #155376.
//@ edition:2018
//@ check-pass
//@ compile-flags: -Zmir-opt-level=0 -Zmir-enable-passes=+DataflowConstProp --crate-type=lib
pub async fn foo(n: usize) {
if n > 0 {
Box::pin(foo(n - 1)).await;
}
}