Closed
Description
Consider the code:
enum Fruit {
Apple(i64),
Orange(i64),
}
fn should_return_fruit() -> Apple {
Apple(5)
}
The current error wording is:
error[E0412]: type name `Apple` is undefined or not in scope
--> <anon>:7:29
|
7 | fn should_return_fruit() -> Apple {
| ^^^^^ undefined or not in scope
|
= help: no candidates by the name of `Apple` found in your project; maybe you misspelled the name or forgot to import an external crate?
I periodically make this exact mistake. It would be really nice if rustc could spot this error and say did you mean Fruit?