@@ -15,22 +15,82 @@ LL | fn fut() -> impl Future<Output = i32> { 42 }
1515 | ^^^^^^
1616
1717error: this function can be simplified using the `async fn` syntax
18- --> $DIR/manual_async_fn.rs:12:1
18+ --> $DIR/manual_async_fn.rs:13:1
19+ |
20+ LL | fn fut2() ->impl Future<Output = i32> {
21+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
22+ |
23+ help: make the function `async` and return the output of the future directly
24+ |
25+ LL | async fn fut2() -> i32 {
26+ | ^^^^^^^^^^^^^^^^^^^^^^
27+ help: move the body of the async block to the enclosing function
28+ |
29+ LL | fn fut2() ->impl Future<Output = i32> { 42 }
30+ | ^^^^^^
31+
32+ error: this function can be simplified using the `async fn` syntax
33+ --> $DIR/manual_async_fn.rs:18:1
34+ |
35+ LL | fn fut3()-> impl Future<Output = i32> {
36+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
37+ |
38+ help: make the function `async` and return the output of the future directly
39+ |
40+ LL | async fn fut3() -> i32 {
41+ | ^^^^^^^^^^^^^^^^^^^^^^
42+ help: move the body of the async block to the enclosing function
43+ |
44+ LL | fn fut3()-> impl Future<Output = i32> { 42 }
45+ | ^^^^^^
46+
47+ error: this function can be simplified using the `async fn` syntax
48+ --> $DIR/manual_async_fn.rs:22:1
1949 |
2050LL | fn empty_fut() -> impl Future<Output = ()> {
2151 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2252 |
2353help: make the function `async` and remove the return type
2454 |
25- LL | async fn empty_fut() {
55+ LL | async fn empty_fut() {
2656 | ^^^^^^^^^^^^^^^^^^^^
2757help: move the body of the async block to the enclosing function
2858 |
2959LL | fn empty_fut() -> impl Future<Output = ()> {}
3060 | ^^
3161
3262error: this function can be simplified using the `async fn` syntax
33- --> $DIR/manual_async_fn.rs:16:1
63+ --> $DIR/manual_async_fn.rs:27:1
64+ |
65+ LL | fn empty_fut2() ->impl Future<Output = ()> {
66+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
67+ |
68+ help: make the function `async` and remove the return type
69+ |
70+ LL | async fn empty_fut2() {
71+ | ^^^^^^^^^^^^^^^^^^^^^
72+ help: move the body of the async block to the enclosing function
73+ |
74+ LL | fn empty_fut2() ->impl Future<Output = ()> {}
75+ | ^^
76+
77+ error: this function can be simplified using the `async fn` syntax
78+ --> $DIR/manual_async_fn.rs:32:1
79+ |
80+ LL | fn empty_fut3()-> impl Future<Output = ()> {
81+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
82+ |
83+ help: make the function `async` and remove the return type
84+ |
85+ LL | async fn empty_fut3() {
86+ | ^^^^^^^^^^^^^^^^^^^^^
87+ help: move the body of the async block to the enclosing function
88+ |
89+ LL | fn empty_fut3()-> impl Future<Output = ()> {}
90+ | ^^
91+
92+ error: this function can be simplified using the `async fn` syntax
93+ --> $DIR/manual_async_fn.rs:36:1
3494 |
3595LL | fn core_fut() -> impl core::future::Future<Output = i32> {
3696 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -45,7 +105,7 @@ LL | fn core_fut() -> impl core::future::Future<Output = i32> { 42 }
45105 | ^^^^^^
46106
47107error: this function can be simplified using the `async fn` syntax
48- --> $DIR/manual_async_fn.rs:38 :5
108+ --> $DIR/manual_async_fn.rs:58 :5
49109 |
50110LL | fn inh_fut() -> impl Future<Output = i32> {
51111 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -65,7 +125,7 @@ LL | let c = 21;
65125 ...
66126
67127error: this function can be simplified using the `async fn` syntax
68- --> $DIR/manual_async_fn.rs:73 :1
128+ --> $DIR/manual_async_fn.rs:93 :1
69129 |
70130LL | fn elided(_: &i32) -> impl Future<Output = i32> + '_ {
71131 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -80,7 +140,7 @@ LL | fn elided(_: &i32) -> impl Future<Output = i32> + '_ { 42 }
80140 | ^^^^^^
81141
82142error: this function can be simplified using the `async fn` syntax
83- --> $DIR/manual_async_fn.rs:82 :1
143+ --> $DIR/manual_async_fn.rs:102 :1
84144 |
85145LL | fn explicit<'a, 'b>(_: &'a i32, _: &'b i32) -> impl Future<Output = i32> + 'a + 'b {
86146 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -94,5 +154,5 @@ help: move the body of the async block to the enclosing function
94154LL | fn explicit<'a, 'b>(_: &'a i32, _: &'b i32) -> impl Future<Output = i32> + 'a + 'b { 42 }
95155 | ^^^^^^
96156
97- error: aborting due to 6 previous errors
157+ error: aborting due to 10 previous errors
98158
0 commit comments