]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/tests/ui/manual_async_fn.stderr
Rollup merge of #78502 - matthewjasper:chalkup, r=nikomatsakis
[rust.git] / src / tools / clippy / 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 indentation 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:73:1
69    |
70 LL | fn elided(_: &i32) -> 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 elided(_: &i32) -> i32 {
76    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
77 help: move the body of the async block to the enclosing function
78    |
79 LL | fn elided(_: &i32) -> 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:82:1
84    |
85 LL | fn explicit<'a, 'b>(_: &'a i32, _: &'b i32) -> impl Future<Output = i32> + 'a + 'b {
86    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
87    |
88 help: make the function `async` and return the output of the future directly
89    |
90 LL | async fn explicit<'a, 'b>(_: &'a i32, _: &'b i32) -> i32 {
91    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
92 help: move the body of the async block to the enclosing function
93    |
94 LL | fn explicit<'a, 'b>(_: &'a i32, _: &'b i32) -> impl Future<Output = i32> + 'a + 'b { 42 }
95    |                                                                                    ^^^^^^
96
97 error: aborting due to 6 previous errors
98