2 #![warn(clippy::manual_async_fn)]
5 use std::future::Future;
7 fn fut() -> impl Future<Output = i32> {
12 fn fut2() ->impl Future<Output = i32> {
17 fn fut3()-> impl Future<Output = i32> {
21 fn empty_fut() -> impl Future<Output = ()> {
26 fn empty_fut2() ->impl Future<Output = ()> {
31 fn empty_fut3()-> impl Future<Output = ()> {
35 fn core_fut() -> impl core::future::Future<Output = i32> {
40 fn has_other_stmts() -> impl core::future::Future<Output = i32> {
51 async fn already_async() -> impl Future<Output = i32> {
57 fn inh_fut() -> impl Future<Output = i32> {
59 // NOTE: this code is here just to check that the indentation is correct in the suggested fix
74 fn not_fut(&self) -> i32 {
79 fn has_other_stmts() -> impl core::future::Future<Output = i32> {
85 async fn already_async(&self) -> impl Future<Output = i32> {
90 // Tests related to lifetime capture
92 fn elided(_: &i32) -> impl Future<Output = i32> + '_ {
97 fn elided_not_bound(_: &i32) -> impl Future<Output = i32> {
101 fn explicit<'a, 'b>(_: &'a i32, _: &'b i32) -> impl Future<Output = i32> + 'a + 'b {
106 #[allow(clippy::needless_lifetimes)]
107 fn explicit_not_bound<'a, 'b>(_: &'a i32, _: &'b i32) -> impl Future<Output = i32> {
113 use std::future::Future;
117 fn f(&self) -> impl Future<Output = ()> {