@@ -9,6 +9,9 @@ LL | fn fut() -> impl Future<Output = i32> {
99help: make the function `async` and return the output of the future directly
1010 |
1111LL - fn fut() -> impl Future<Output = i32> {
12+ LL -
13+ LL - async { 42 }
14+ LL - }
1215LL + async fn fut() -> i32 { 42 }
1316 |
1417
@@ -21,6 +24,9 @@ LL | fn fut2() ->impl Future<Output = i32> {
2124help: make the function `async` and return the output of the future directly
2225 |
2326LL - fn fut2() ->impl Future<Output = i32> {
27+ LL -
28+ LL - async { 42 }
29+ LL - }
2430LL + async fn fut2() -> i32 { 42 }
2531 |
2632
@@ -33,6 +39,9 @@ LL | fn fut3()-> impl Future<Output = i32> {
3339help: make the function `async` and return the output of the future directly
3440 |
3541LL - fn fut3()-> impl Future<Output = i32> {
42+ LL -
43+ LL - async { 42 }
44+ LL - }
3645LL + async fn fut3() -> i32 { 42 }
3746 |
3847
@@ -45,6 +54,9 @@ LL | fn empty_fut() -> impl Future<Output = ()> {
4554help: make the function `async` and return the output of the future directly
4655 |
4756LL - fn empty_fut() -> impl Future<Output = ()> {
57+ LL -
58+ LL - async {}
59+ LL - }
4860LL + async fn empty_fut() {}
4961 |
5062
@@ -57,6 +69,9 @@ LL | fn empty_fut2() ->impl Future<Output = ()> {
5769help: make the function `async` and return the output of the future directly
5870 |
5971LL - fn empty_fut2() ->impl Future<Output = ()> {
72+ LL -
73+ LL - async {}
74+ LL - }
6075LL + async fn empty_fut2() {}
6176 |
6277
@@ -69,6 +84,9 @@ LL | fn empty_fut3()-> impl Future<Output = ()> {
6984help: make the function `async` and return the output of the future directly
7085 |
7186LL - fn empty_fut3()-> impl Future<Output = ()> {
87+ LL -
88+ LL - async {}
89+ LL - }
7290LL + async fn empty_fut3() {}
7391 |
7492
@@ -81,6 +99,9 @@ LL | fn core_fut() -> impl core::future::Future<Output = i32> {
8199help: make the function `async` and return the output of the future directly
82100 |
83101LL - fn core_fut() -> impl core::future::Future<Output = i32> {
102+ LL -
103+ LL - async move { 42 }
104+ LL - }
84105LL + async fn core_fut() -> i32 { 42 }
85106 |
86107
@@ -116,6 +137,9 @@ LL | fn elided(_: &i32) -> impl Future<Output = i32> + '_ {
116137help: make the function `async` and return the output of the future directly
117138 |
118139LL - fn elided(_: &i32) -> impl Future<Output = i32> + '_ {
140+ LL -
141+ LL - async { 42 }
142+ LL - }
119143LL + async fn elided(_: &i32) -> i32 { 42 }
120144 |
121145
@@ -128,6 +152,9 @@ LL | fn explicit<'a, 'b>(_: &'a i32, _: &'b i32) -> impl Future<Output = i32> +
128152help: make the function `async` and return the output of the future directly
129153 |
130154LL - fn explicit<'a, 'b>(_: &'a i32, _: &'b i32) -> impl Future<Output = i32> + 'a + 'b {
155+ LL -
156+ LL - async { 42 }
157+ LL - }
131158LL + async fn explicit<'a, 'b>(_: &'a i32, _: &'b i32) -> i32 { 42 }
132159 |
133160
@@ -140,6 +167,9 @@ LL | pub fn issue_10450() -> impl Future<Output = i32> {
140167help: make the function `async` and return the output of the future directly
141168 |
142169LL - pub fn issue_10450() -> impl Future<Output = i32> {
170+ LL -
171+ LL - async { 42 }
172+ LL - }
143173LL + pub async fn issue_10450() -> i32 { 42 }
144174 |
145175
@@ -152,6 +182,9 @@ LL | pub(crate) fn issue_10450_2() -> impl Future<Output = i32> {
152182help: make the function `async` and return the output of the future directly
153183 |
154184LL - pub(crate) fn issue_10450_2() -> impl Future<Output = i32> {
185+ LL -
186+ LL - async { 42 }
187+ LL - }
155188LL + pub(crate) async fn issue_10450_2() -> i32 { 42 }
156189 |
157190
@@ -164,6 +197,9 @@ LL | pub(self) fn issue_10450_3() -> impl Future<Output = i32> {
164197help: make the function `async` and return the output of the future directly
165198 |
166199LL - pub(self) fn issue_10450_3() -> impl Future<Output = i32> {
200+ LL -
201+ LL - async { 42 }
202+ LL - }
167203LL + pub(self) async fn issue_10450_3() -> i32 { 42 }
168204 |
169205
0 commit comments