mirror of
https://github.com/rust-lang/rust.git
synced 2025-10-22 21:11:20 +00:00

Suggest `return`ing tail expressions that match return type Some newcomers are confused by the behavior of tail expressions, interpreting that "leaving out the `;` makes it the return value". To help them go in the right direction, suggest using `return` instead when applicable.
For high-level intro to how type checking works in rustc, see the type checking chapter of the rustc dev guide.