]> git.lizzy.rs Git - rust.git/commitdiff
Auto merge of #5909 - khuey:async_yields_async, r=yaahc
authorbors <bors@rust-lang.org>
Mon, 31 Aug 2020 19:20:30 +0000 (19:20 +0000)
committerbors <bors@rust-lang.org>
Mon, 31 Aug 2020 19:20:30 +0000 (19:20 +0000)
Add a lint for an async block/closure that yields a type that is itself awaitable.

This catches bugs of the form

tokio::spawn(async move {
    let f = some_async_thing();
    f // Oh no I forgot to await f so that work will never complete.
});

See the two XXXkhuey comments and the unfixed `_l` structure for things that need more thought.

*Please keep the line below*
changelog: none


Trivial merge