-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsC-bugCategory: This is a bug.Category: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
I got the following error today:
error[E0308]: mismatched types
--> src/util.rs:13:33
|
13 | fn from_str(input: &str) -> Result<Self, Self::Err> {
| -------- ^^^^^^^^^^^^^^^^^^^^^^^ expected enum `std::result::Result`, found ()
| |
| this function's body doesn't return
|
= note: expected type `std::result::Result<util::Color, &'static str>`
found type `()`
error: aborting due to previous error
For more information about this error, try `rustc --explain E0308`.
I think the note this function's body doesn't return
is misleading - I thought that the issue was that an inner method I was calling had an infinite loop, or returned !
some other way, but it doesn't mean this, it actually means "this function's body doesn't return a value". Maybe the error message could be changed?
Patryk27
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsC-bugCategory: This is a bug.Category: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.