2 #![warn(clippy::manual_async_fn)]
5 use std::future::Future;
7 async fn fut() -> i32 { 42 }
10 async fn fut2() -> i32 { 42 }
13 async fn fut3() -> i32 { 42 }
15 async fn empty_fut() {}
18 async fn empty_fut2() {}
21 async fn empty_fut3() {}
23 async fn core_fut() -> i32 { 42 }
26 fn has_other_stmts() -> impl core::future::Future<Output = i32> {
37 async fn already_async() -> impl Future<Output = i32> {
43 async fn inh_fut() -> i32 {
44 // NOTE: this code is here just to check that the indentation is correct in the suggested fix
58 fn not_fut(&self) -> i32 {
63 fn has_other_stmts() -> impl core::future::Future<Output = i32> {
69 async fn already_async(&self) -> impl Future<Output = i32> {
74 // Tests related to lifetime capture
76 async fn elided(_: &i32) -> i32 { 42 }
79 fn elided_not_bound(_: &i32) -> impl Future<Output = i32> {
83 async fn explicit<'a, 'b>(_: &'a i32, _: &'b i32) -> i32 { 42 }
86 #[allow(clippy::needless_lifetimes)]
87 fn explicit_not_bound<'a, 'b>(_: &'a i32, _: &'b i32) -> impl Future<Output = i32> {
93 use std::future::Future;
97 fn f(&self) -> impl Future<Output = ()> {