]> git.lizzy.rs Git - rust.git/blob - tests/ui/manual_async_fn.stderr
016fdf959772a8320f12cd667168bccd44b0ceca
[rust.git] / tests / ui / manual_async_fn.stderr
1 error: this function can be simplified using async 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 async 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 async 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 async 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> { 42 }
60    |                                               ^^^^^^
61
62 error: this function can be simplified using async syntax
63   --> $DIR/manual_async_fn.rs:42:5
64    |
65 LL |     fn meth_fut(&self) -> impl Future<Output = i32> {
66    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
67    |
68 help: make the function `async` and return the output of the future directly
69    |
70 LL |     async fn meth_fut(&self) -> i32 {
71    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
72 help: move the body of the async block to the enclosing function
73    |
74 LL |     fn meth_fut(&self) -> impl Future<Output = i32> { 42 }
75    |                                                     ^^^^^^
76
77 error: this function can be simplified using async syntax
78   --> $DIR/manual_async_fn.rs:46:5
79    |
80 LL |     fn empty_fut(&self) -> impl Future<Output = ()> {
81    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
82    |
83 help: make the function `async` and remove the return type
84    |
85 LL |     async fn empty_fut(&self)  {
86    |     ^^^^^^^^^^^^^^^^^^^^^^^^^
87 help: move the body of the async block to the enclosing function
88    |
89 LL |     fn empty_fut(&self) -> impl Future<Output = ()> {}
90    |                                                     ^^
91
92 error: aborting due to 6 previous errors
93