diff options
| author | bors <bors@rust-lang.org> | 2021-05-17 06:00:55 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2021-05-17 06:00:55 +0000 |
| commit | acdf43f2575d534893840091c6c0a19b861ab263 (patch) | |
| tree | 3d7521ce2a5242fef39a141112c56833d1961613 /library/std/src/sys/unix/stack_overflow.rs | |
| parent | 44e07476647ffb26f1aae034813a7ca430cb37b9 (diff) | |
| parent | 75ef9dc708e669bccbc18c3be4873c613058ef30 (diff) | |
| download | rust-acdf43f2575d534893840091c6c0a19b861ab263.tar.gz rust-acdf43f2575d534893840091c6c0a19b861ab263.zip | |
Auto merge of #7225 - InquisitivePenguin:unnessecary-async, r=llogiq
New lint: `unused_async`
changelog: Adds a lint, `unused_async`, which checks for async functions with no await statements
`unused_async` is a lint that reduces code smell and overhead by encouraging async functions to be refactored into synchronous functions.
Fixes #7176
### Examples
```rust
async fn get_random_number() -> i64 {
4 // Chosen by fair dice roll. Guaranteed to be random.
}
```
Could be written as:
```rust
fn get_random_number() -> i64 {
4 // Chosen by fair dice roll. Guaranteed to be random.
}
```
Something like this, however, should **not** be caught by clippy:
```rust
#[async_trait]
trait AsyncTrait {
async fn foo();
}
struct Bar;
#[async_trait]
impl AsyncTrait for Bar {
async fn foo() {
println!("bar");
}
}
```
Diffstat (limited to 'library/std/src/sys/unix/stack_overflow.rs')
0 files changed, 0 insertions, 0 deletions
