Closed
Description
The error message that I get looks like this:
src/main.rs:18:9: 18:11 error: unable to infer enough type information about `_`; type annotations required [E0282]
src/main.rs: 18 Ok(Response::with( (status::Ok, payload) ));
error: aborting due to previous error
The highlight is on the leading Ok
, which is misleading. The actual fix was to either precede the statement with return
, or to drop the trailing ;
. It would be great if the compiler were to suggest this as well, as the current error message alone is cryptic.
Metadata
Metadata
Assignees
Labels
Area: Messages for errors, warnings, and lintsCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.Call for participation: An issue has been fixed and does not reproduce, but no test has been added.Relevant to the compiler team, which will review and decide on the PR/issue.