rust/compiler/rustc_typeck
Dylan DPC 97c9f16a45
Rollup merge of #98784 - compiler-errors:forgot-to-return-binding, r=estebank
Suggest returning local on "expected `ty`, found `()`" due to expr-less block

Putting this up for _initial_ review. Notably, this doesn't consider if the value has possibly been moved, or whether the type is `Copy`. It also provides a structured suggestion if there's one "preferred" binding that matches the type (i.e. one binding in the block or its parent), otherwise it just points them out if there's fewer than 4 of them.

Fixes #98177

r? `@estebank`
2022-07-20 11:29:37 +05:30
..
src Rollup merge of #98784 - compiler-errors:forgot-to-return-binding, r=estebank 2022-07-20 11:29:37 +05:30
Cargo.toml
README.md

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