Closed
Description
enum Foo {
Bar
}
impl Foo {
fn foo() -> Self {
Self::Bar
}
}
gives the error
error[E0599]: no variant named `Bar` found for type `Foo` in the current scope
--> src/main.rs:7:9
|
1 | enum Foo {
| -------- variant `Bar` not found here
...
7 | Self::Bar
| ^^^^^^^^^ variant not found in `Foo`
|
= note: did you mean `Foo::Bar`?
error: aborting due to previous error
The "variant not found" bit is nonsense.