mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-27 15:11:30 +00:00
e8403a892b
[`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 |
||
---|---|---|
.. | ||
test_utils | ||
ui | ||
ui-cargo | ||
ui-internal | ||
ui-toml | ||
workspace_test | ||
check-fmt.rs | ||
clippy.toml | ||
compile-test.rs | ||
dogfood.rs | ||
headers.rs | ||
integration.rs | ||
lint_message_convention.rs | ||
missing-test-files.rs | ||
versioncheck.rs | ||
workspace.rs |