1
Fork 0

Add additional tests for static AFIT

This commit is contained in:
Bryan Garza 2022-10-07 16:15:13 +00:00
parent 11b1439380
commit 9a05081d5f
9 changed files with 169 additions and 0 deletions

View file

@ -0,0 +1,21 @@
// edition: 2021
#![feature(async_fn_in_trait)]
#![allow(incomplete_features)]
trait MyTrait<T> {
async fn foo_recursive(&self, n: usize) -> T;
}
impl<T> MyTrait<T> for T where T: Copy {
async fn foo_recursive(&self, n: usize) -> T {
//~^ ERROR recursion in an `async fn` requires boxing
if n > 0 {
self.foo_recursive(n - 1).await
} else {
*self
}
}
}
fn main() {}