E0277 should put emphasis on containing function's return type #63078
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
E-easy
Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
F-on_unimplemented
Error messages that can be tackled with `#[rustc_on_unimplemented]`
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
I got the following error today:
I was confused for a minute as I misinterpreted what the error was saying. I double-checked that
reqwest::get
does indeed return aResult
but a moment later I realized that it's the function that's containingreqwest::get
I should be looking at which indeed did return()
after which I fixed the issue.I believe this error message could be somehow improved and/or worded differently to put more stress on the containing function - after all, that's what I should've looked at (maybe the containing function should be even shown in the error message like
reqwest::get
is?) though I can see how it can not always be the case. However, I do still think both the containing method's return type and thereqwest::get
call should be highlighted for the best experience and to easily allow a full understanding of what's happening.The text was updated successfully, but these errors were encountered: