Use Box::pin:
async fn test(data: i32) -> i32 { if data == 0 { 0 } else { Box::pin(test(data - 1)).await } }