]> git.lizzy.rs Git - rust.git/blob - tests/ui/manual_async_fn.stderr
Auto merge of #6338 - flip1995:rustup, r=flip1995
[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: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
49    |
50 LL | fn empty_fut() -> impl Future<Output = ()> {
51    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
52    |
53 help: make the function `async` and remove the return type
54    |
55 LL | async fn empty_fut() {
56    | ^^^^^^^^^^^^^^^^^^^^
57 help: move the body of the async block to the enclosing function
58    |
59 LL | fn empty_fut() -> impl Future<Output = ()> {}
60    |                                            ^^
61
62 error: this function can be simplified using the `async fn` syntax
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
94    |
95 LL | fn core_fut() -> impl core::future::Future<Output = i32> {
96    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
97    |
98 help: make the function `async` and return the output of the future directly
99    |
100 LL | async fn core_fut() -> i32 {
101    | ^^^^^^^^^^^^^^^^^^^^^^^^^^
102 help: move the body of the async block to the enclosing function
103    |
104 LL | fn core_fut() -> impl core::future::Future<Output = i32> { 42 }
105    |                                                          ^^^^^^
106
107 error: this function can be simplified using the `async fn` syntax
108   --> $DIR/manual_async_fn.rs:58:5
109    |
110 LL |     fn inh_fut() -> impl Future<Output = i32> {
111    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
112    |
113 help: make the function `async` and return the output of the future directly
114    |
115 LL |     async fn inh_fut() -> i32 {
116    |     ^^^^^^^^^^^^^^^^^^^^^^^^^
117 help: move the body of the async block to the enclosing function
118    |
119 LL |     fn inh_fut() -> impl Future<Output = i32> {
120 LL |         // NOTE: this code is here just to check that the indentation is correct in the suggested fix
121 LL |         let a = 42;
122 LL |         let b = 21;
123 LL |         if a < b {
124 LL |             let c = 21;
125  ...
126
127 error: this function can be simplified using the `async fn` syntax
128   --> $DIR/manual_async_fn.rs:93:1
129    |
130 LL | fn elided(_: &i32) -> impl Future<Output = i32> + '_ {
131    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
132    |
133 help: make the function `async` and return the output of the future directly
134    |
135 LL | async fn elided(_: &i32) -> i32 {
136    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
137 help: move the body of the async block to the enclosing function
138    |
139 LL | fn elided(_: &i32) -> impl Future<Output = i32> + '_ { 42 }
140    |                                                      ^^^^^^
141
142 error: this function can be simplified using the `async fn` syntax
143   --> $DIR/manual_async_fn.rs:102:1
144    |
145 LL | fn explicit<'a, 'b>(_: &'a i32, _: &'b i32) -> impl Future<Output = i32> + 'a + 'b {
146    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
147    |
148 help: make the function `async` and return the output of the future directly
149    |
150 LL | async fn explicit<'a, 'b>(_: &'a i32, _: &'b i32) -> i32 {
151    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
152 help: move the body of the async block to the enclosing function
153    |
154 LL | fn explicit<'a, 'b>(_: &'a i32, _: &'b i32) -> impl Future<Output = i32> + 'a + 'b { 42 }
155    |                                                                                    ^^^^^^
156
157 error: aborting due to 10 previous errors
158