On functions with return type and no returned value, point at appropriate bindings to be returned #98177
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
D-papercut
Diagnostics: An error or lint that needs small tweaks.
D-terse
Diagnostics: An error or lint that doesn't give enough information about the problem at hand.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
When encountering a function with an explicit return type, but the function body doesn't return anything, we should inspect the body's bindings and point out all that have an appropriate type:
Potentially consider the implications of lifetimes, particularly for bindings that are a borrowed value. Also make an effort not to drown the output if more than N bindings would apply in really big functions.
The text was updated successfully, but these errors were encountered: