]> git.lizzy.rs Git - rust.git/blob - tests/ui/manual_async_fn.stderr
iterate List by value
[rust.git] / tests / ui / manual_async_fn.stderr
1 error: this function can be simplified using the `async fn` syntax
2   --> $DIR/manual_async_fn.rs:8:1
3    |
4 LL | fn fut() -> impl Future<Output = i32> {
5    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6    |
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
9    |
10 LL | async fn fut() -> i32 {
11    | ^^^^^^^^^^^^^^^^^^^^^
12 help: move the body of the async block to the enclosing function
13    |
14 LL | fn fut() -> impl Future<Output = i32> { 42 }
15    |                                       ^^^^^^
16
17 error: this function can be simplified using the `async fn` syntax
18   --> $DIR/manual_async_fn.rs:12:1
19    |
20 LL | fn empty_fut() -> impl Future<Output = ()> {
21    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
22    |
23 help: make the function `async` and remove the return type
24    |
25 LL | async fn empty_fut()  {
26    | ^^^^^^^^^^^^^^^^^^^^
27 help: move the body of the async block to the enclosing function
28    |
29 LL | fn empty_fut() -> impl Future<Output = ()> {}
30    |                                            ^^
31
32 error: this function can be simplified using the `async fn` syntax
33   --> $DIR/manual_async_fn.rs:16:1
34    |
35 LL | fn core_fut() -> impl core::future::Future<Output = i32> {
36    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
37    |
38 help: make the function `async` and return the output of the future directly
39    |
40 LL | async fn core_fut() -> i32 {
41    | ^^^^^^^^^^^^^^^^^^^^^^^^^^
42 help: move the body of the async block to the enclosing function
43    |
44 LL | fn core_fut() -> impl core::future::Future<Output = i32> { 42 }
45    |                                                          ^^^^^^
46
47 error: this function can be simplified using the `async fn` syntax
48   --> $DIR/manual_async_fn.rs:38:5
49    |
50 LL |     fn inh_fut() -> impl Future<Output = i32> {
51    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
52    |
53 help: make the function `async` and return the output of the future directly
54    |
55 LL |     async fn inh_fut() -> i32 {
56    |     ^^^^^^^^^^^^^^^^^^^^^^^^^
57 help: move the body of the async block to the enclosing function
58    |
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  ...
66
67 error: this function can be simplified using the `async fn` syntax
68   --> $DIR/manual_async_fn.rs:54:5
69    |
70 LL |     fn meth_fut(&self) -> impl Future<Output = i32> {
71    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
72    |
73 help: make the function `async` and return the output of the future directly
74    |
75 LL |     async fn meth_fut(&self) -> i32 {
76    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
77 help: move the body of the async block to the enclosing function
78    |
79 LL |     fn meth_fut(&self) -> impl Future<Output = i32> { 42 }
80    |                                                     ^^^^^^
81
82 error: this function can be simplified using the `async fn` syntax
83   --> $DIR/manual_async_fn.rs:58:5
84    |
85 LL |     fn empty_fut(&self) -> impl Future<Output = ()> {
86    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
87    |
88 help: make the function `async` and remove the return type
89    |
90 LL |     async fn empty_fut(&self)  {
91    |     ^^^^^^^^^^^^^^^^^^^^^^^^^
92 help: move the body of the async block to the enclosing function
93    |
94 LL |     fn empty_fut(&self) -> impl Future<Output = ()> {}
95    |                                                     ^^
96
97 error: aborting due to 6 previous errors
98