1- error: this function can be simplified using async syntax
1+ error: this function can be simplified using the ` async fn` syntax
22 --> $DIR/manual_async_fn.rs:8:1
33 |
44LL | fn fut() -> impl Future<Output = i32> {
@@ -14,7 +14,7 @@ help: move the body of the async block to the enclosing function
1414LL | fn fut() -> impl Future<Output = i32> { 42 }
1515 | ^^^^^^
1616
17- error: this function can be simplified using async syntax
17+ error: this function can be simplified using the ` async fn` syntax
1818 --> $DIR/manual_async_fn.rs:12:1
1919 |
2020LL | fn empty_fut() -> impl Future<Output = ()> {
@@ -29,7 +29,7 @@ help: move the body of the async block to the enclosing function
2929LL | fn empty_fut() -> impl Future<Output = ()> {}
3030 | ^^
3131
32- error: this function can be simplified using async syntax
32+ error: this function can be simplified using the ` async fn` syntax
3333 --> $DIR/manual_async_fn.rs:16:1
3434 |
3535LL | fn core_fut() -> impl core::future::Future<Output = i32> {
@@ -44,7 +44,7 @@ help: move the body of the async block to the enclosing function
4444LL | fn core_fut() -> impl core::future::Future<Output = i32> { 42 }
4545 | ^^^^^^
4646
47- error: this function can be simplified using async syntax
47+ error: this function can be simplified using the ` async fn` syntax
4848 --> $DIR/manual_async_fn.rs:38:5
4949 |
5050LL | fn inh_fut() -> impl Future<Output = i32> {
@@ -56,11 +56,16 @@ LL | async fn inh_fut() -> i32 {
5656 | ^^^^^^^^^^^^^^^^^^^^^^^^^
5757help: move the body of the async block to the enclosing function
5858 |
59- LL | fn inh_fut() -> impl Future<Output = i32> { 42 }
60- | ^^^^^^
59+ LL | fn inh_fut() -> impl Future<Output = i32> {
60+ LL | // NOTE: this code is here just to check that the identation is correct in the suggested fix
61+ LL | let a = 42;
62+ LL | let b = 21;
63+ LL | if a < b {
64+ LL | let c = 21;
65+ ...
6166
62- error: this function can be simplified using async syntax
63- --> $DIR/manual_async_fn.rs:42 :5
67+ error: this function can be simplified using the ` async fn` syntax
68+ --> $DIR/manual_async_fn.rs:54 :5
6469 |
6570LL | fn meth_fut(&self) -> impl Future<Output = i32> {
6671 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -74,8 +79,8 @@ help: move the body of the async block to the enclosing function
7479LL | fn meth_fut(&self) -> impl Future<Output = i32> { 42 }
7580 | ^^^^^^
7681
77- error: this function can be simplified using async syntax
78- --> $DIR/manual_async_fn.rs:46 :5
82+ error: this function can be simplified using the ` async fn` syntax
83+ --> $DIR/manual_async_fn.rs:58 :5
7984 |
8085LL | fn empty_fut(&self) -> impl Future<Output = ()> {
8186 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
0 commit comments