rust/compiler/rustc_typeck
Matthias Krüger 347c744fe0
Rollup merge of #92381 - ThePuzzlemaker:issue-92308, r=estebank
Suggest `return`ing tail expressions in async functions

This PR fixes #92308.

Previously, the suggestion to `return` tail expressions (introduced in #81769) did not apply to `async` functions, as the suggestion checked whether the types were equal disregarding `impl Future<Output = T>` syntax sugar for `async` functions. This PR changes that in order to fix a potential papercut.

I'm not sure if this is the "right" way to do this, so if there is a better way then please let me know.

I amended an existing test introduced in #81769 to add a regression test for this, if you think I should make a separate test I will.
2022-01-14 07:47:32 +01:00
..
src Rollup merge of #92381 - ThePuzzlemaker:issue-92308, r=estebank 2022-01-14 07:47:32 +01:00
Cargo.toml Migrate to 2021 2021-09-20 22:21:42 -04:00
README.md

For high-level intro to how type checking works in rustc, see the type checking chapter of the rustc dev guide.