]> git.lizzy.rs Git - rust.git/blob - tests/ui/async-await/mutually-recursive-async-impl-trait-type.rs
Auto merge of #107843 - bjorn3:sync_cg_clif-2023-02-09, r=bjorn3
[rust.git] / tests / ui / async-await / mutually-recursive-async-impl-trait-type.rs
1 // revisions: no_drop_tracking drop_tracking drop_tracking_mir
2 // [drop_tracking] compile-flags: -Zdrop-tracking
3 // [drop_tracking_mir] compile-flags: -Zdrop-tracking-mir
4
5 // edition:2018
6 // Test that impl trait does not allow creating recursive types that are
7 // otherwise forbidden when using `async` and `await`.
8
9 async fn rec_1() { //~ ERROR recursion in an `async fn`
10     rec_2().await;
11 }
12
13 async fn rec_2() { //~ ERROR recursion in an `async fn`
14     rec_1().await;
15 }
16
17 fn main() {}