1 error: this function can be simplified using the `async fn` syntax
2 --> $DIR/manual_async_fn.rs:7:1
4 LL | fn fut() -> impl Future<Output = i32> {
5 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
7 = note: `-D clippy::manual-async-fn` implied by `-D warnings`
8 help: make the function `async` and return the output of the future directly
10 LL | async fn fut() -> i32 {
11 | ~~~~~~~~~~~~~~~~~~~~~
12 help: move the body of the async block to the enclosing function
14 LL | fn fut() -> impl Future<Output = i32> { 42 }
17 error: this function can be simplified using the `async fn` syntax
18 --> $DIR/manual_async_fn.rs:12:1
20 LL | fn fut2() ->impl Future<Output = i32> {
21 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
23 help: make the function `async` and return the output of the future directly
25 LL | async fn fut2() -> i32 {
26 | ~~~~~~~~~~~~~~~~~~~~~~
27 help: move the body of the async block to the enclosing function
29 LL | fn fut2() ->impl Future<Output = i32> { 42 }
32 error: this function can be simplified using the `async fn` syntax
33 --> $DIR/manual_async_fn.rs:17:1
35 LL | fn fut3()-> impl Future<Output = i32> {
36 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
38 help: make the function `async` and return the output of the future directly
40 LL | async fn fut3() -> i32 {
41 | ~~~~~~~~~~~~~~~~~~~~~~
42 help: move the body of the async block to the enclosing function
44 LL | fn fut3()-> impl Future<Output = i32> { 42 }
47 error: this function can be simplified using the `async fn` syntax
48 --> $DIR/manual_async_fn.rs:21:1
50 LL | fn empty_fut() -> impl Future<Output = ()> {
51 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
53 help: make the function `async` and remove the return type
55 LL | async fn empty_fut() {
56 | ~~~~~~~~~~~~~~~~~~~~
57 help: move the body of the async block to the enclosing function
59 LL | fn empty_fut() -> impl Future<Output = ()> {}
62 error: this function can be simplified using the `async fn` syntax
63 --> $DIR/manual_async_fn.rs:26:1
65 LL | fn empty_fut2() ->impl Future<Output = ()> {
66 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
68 help: make the function `async` and remove the return type
70 LL | async fn empty_fut2() {
71 | ~~~~~~~~~~~~~~~~~~~~~
72 help: move the body of the async block to the enclosing function
74 LL | fn empty_fut2() ->impl Future<Output = ()> {}
77 error: this function can be simplified using the `async fn` syntax
78 --> $DIR/manual_async_fn.rs:31:1
80 LL | fn empty_fut3()-> impl Future<Output = ()> {
81 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
83 help: make the function `async` and remove the return type
85 LL | async fn empty_fut3() {
86 | ~~~~~~~~~~~~~~~~~~~~~
87 help: move the body of the async block to the enclosing function
89 LL | fn empty_fut3()-> impl Future<Output = ()> {}
92 error: this function can be simplified using the `async fn` syntax
93 --> $DIR/manual_async_fn.rs:35:1
95 LL | fn core_fut() -> impl core::future::Future<Output = i32> {
96 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
98 help: make the function `async` and return the output of the future directly
100 LL | async fn core_fut() -> i32 {
101 | ~~~~~~~~~~~~~~~~~~~~~~~~~~
102 help: move the body of the async block to the enclosing function
104 LL | fn core_fut() -> impl core::future::Future<Output = i32> { 42 }
107 error: this function can be simplified using the `async fn` syntax
108 --> $DIR/manual_async_fn.rs:57:5
110 LL | fn inh_fut() -> impl Future<Output = i32> {
111 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
113 help: make the function `async` and return the output of the future directly
115 LL | async fn inh_fut() -> i32 {
116 | ~~~~~~~~~~~~~~~~~~~~~~~~~
117 help: move the body of the async block to the enclosing function
119 LL ~ fn inh_fut() -> impl Future<Output = i32> {
120 LL + // NOTE: this code is here just to check that the indentation is correct in the suggested fix
127 error: this function can be simplified using the `async fn` syntax
128 --> $DIR/manual_async_fn.rs:92:1
130 LL | fn elided(_: &i32) -> impl Future<Output = i32> + '_ {
131 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
133 help: make the function `async` and return the output of the future directly
135 LL | async fn elided(_: &i32) -> i32 {
136 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
137 help: move the body of the async block to the enclosing function
139 LL | fn elided(_: &i32) -> impl Future<Output = i32> + '_ { 42 }
142 error: this function can be simplified using the `async fn` syntax
143 --> $DIR/manual_async_fn.rs:101:1
145 LL | fn explicit<'a, 'b>(_: &'a i32, _: &'b i32) -> impl Future<Output = i32> + 'a + 'b {
146 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
148 help: make the function `async` and return the output of the future directly
150 LL | async fn explicit<'a, 'b>(_: &'a i32, _: &'b i32) -> i32 {
151 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
152 help: move the body of the async block to the enclosing function
154 LL | fn explicit<'a, 'b>(_: &'a i32, _: &'b i32) -> impl Future<Output = i32> + 'a + 'b { 42 }
157 error: aborting due to 10 previous errors