forked from rust-lang/rust-clippy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of rust-lang#10490 - samueltardieu:issue-10482, r=xFrednet
Do not propose to remove `async move` if variables are captured by ref Fixes rust-lang#10482 changelog: FP [`redundant_async_block`] Do not propose to remove `async move` if variables are captured by ref
- Loading branch information
Showing
4 changed files
with
147 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,40 @@ | ||
error: this async expression only awaits a single future | ||
--> $DIR/redundant_async_block.rs:13:13 | ||
--> $DIR/redundant_async_block.rs:15:13 | ||
| | ||
LL | let x = async { f.await }; | ||
| ^^^^^^^^^^^^^^^^^ help: you can reduce it to: `f` | ||
| | ||
= note: `-D clippy::redundant-async-block` implied by `-D warnings` | ||
|
||
error: this async expression only awaits a single future | ||
--> $DIR/redundant_async_block.rs:46:16 | ||
--> $DIR/redundant_async_block.rs:48:16 | ||
| | ||
LL | let fut2 = async { fut1.await }; | ||
| ^^^^^^^^^^^^^^^^^^^^ help: you can reduce it to: `fut1` | ||
|
||
error: this async expression only awaits a single future | ||
--> $DIR/redundant_async_block.rs:49:16 | ||
--> $DIR/redundant_async_block.rs:51:16 | ||
| | ||
LL | let fut2 = async move { fut1.await }; | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can reduce it to: `fut1` | ||
|
||
error: this async expression only awaits a single future | ||
--> $DIR/redundant_async_block.rs:51:15 | ||
--> $DIR/redundant_async_block.rs:53:15 | ||
| | ||
LL | let fut = async { async { 42 }.await }; | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can reduce it to: `async { 42 }` | ||
|
||
error: aborting due to 4 previous errors | ||
error: this async expression only awaits a single future | ||
--> $DIR/redundant_async_block.rs:72:5 | ||
| | ||
LL | async move { fut.await } | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: you can reduce it to: `fut` | ||
|
||
error: this async expression only awaits a single future | ||
--> $DIR/redundant_async_block.rs:85:5 | ||
| | ||
LL | async move { fut.await } | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: you can reduce it to: `fut` | ||
|
||
error: aborting due to 6 previous errors | ||
|