mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-15 09:27:25 +00:00
40 lines
1.1 KiB
Text
40 lines
1.1 KiB
Text
error: unused `async` for function with no await statements
|
|
--> $DIR/unused_async.rs:13:5
|
|
|
|
|
LL | / async fn async_block_await() {
|
|
LL | | async {
|
|
LL | | ready(()).await;
|
|
LL | | };
|
|
LL | | }
|
|
| |_____^
|
|
|
|
|
= help: consider removing the `async` from this function
|
|
note: `await` used in an async block, which does not require the enclosing function to be `async`
|
|
--> $DIR/unused_async.rs:15:23
|
|
|
|
|
LL | ready(()).await;
|
|
| ^^^^^
|
|
= note: `-D clippy::unused-async` implied by `-D warnings`
|
|
|
|
error: unused `async` for function with no await statements
|
|
--> $DIR/unused_async.rs:40:1
|
|
|
|
|
LL | / async fn foo() -> i32 {
|
|
LL | | 4
|
|
LL | | }
|
|
| |_^
|
|
|
|
|
= help: consider removing the `async` from this function
|
|
|
|
error: unused `async` for function with no await statements
|
|
--> $DIR/unused_async.rs:51:5
|
|
|
|
|
LL | / async fn unused(&self) -> i32 {
|
|
LL | | 1
|
|
LL | | }
|
|
| |_____^
|
|
|
|
|
= help: consider removing the `async` from this function
|
|
|
|
error: aborting due to 3 previous errors
|
|
|