about summary refs log tree commit diff
path: root/compiler/rustc_codegen_gcc
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-07-22 20:40:48 +0000
committerbors <bors@rust-lang.org>2023-07-22 20:40:48 +0000
commite8403a892b8d10cb620bc0525dbb2d9d2c4f39ed (patch)
treeec8f3e554e94a869b364cc695c39503e7bdc4bf0 /compiler/rustc_codegen_gcc
parentea21ed7f1091a4d733c1eac7cc7fa834d5818684 (diff)
parent482d5fafc9ffc7edf9236ea186883ee0346e7938 (diff)
downloadrust-e8403a892b8d10cb620bc0525dbb2d9d2c4f39ed.tar.gz
rust-e8403a892b8d10cb620bc0525dbb2d9d2c4f39ed.zip
Auto merge of #11200 - y21:issue9695, r=Jarcho
[`unused_async`]: don't lint if paths reference async fn without immediate call

Fixes #9695
Fixes #9359

Clippy shouldn't lint unused `async` if there are paths referencing them if that path isn't the receiver of a function call, because that means that the function might be passed to some other function:
```rs
async fn f() {} // No await statements, so unused at this point

fn requires_fn_future<F: Future<Output = ()>>(_: fn() -> F) {}
requires_fn_future(f); // `f`'s asyncness is actually not unused.
```
(This isn't limited to just passing the function as a parameter to another function, it could also first be stored in a variable and later passed to another function as an argument)

This requires delaying the linting until post-crate and collecting path references to local async functions along the way.

changelog: [`unused_async`]: don't lint if paths reference async fn that require asyncness
Diffstat (limited to 'compiler/rustc_codegen_gcc')
0 files changed, 0 insertions, 0 deletions