]> git.lizzy.rs Git - rust.git/commitdiff
Rollup merge of #100633 - estebank:must_use_async_fn_return, r=tmandry
authorDylan DPC <99973273+Dylan-DPC@users.noreply.github.com>
Fri, 11 Nov 2022 15:21:38 +0000 (20:51 +0530)
committerGitHub <noreply@github.com>
Fri, 11 Nov 2022 15:21:38 +0000 (20:51 +0530)
Consider `#[must_use]` annotation on `async fn` as also affecting the `Future::Output`

No longer lint against `#[must_use] async fn foo()`.

When encountering a statement that awaits on a `Future`, check if the
`Future`'s parent item is annotated with `#[must_use]` and emit a lint
if so. This effectively makes `must_use` an annotation on the
`Future::Output` instead of only the `Future` itself.

Fix #78149.


Trivial merge