Closed
Description
Given the following code: https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=a494a5e7386a6c9e55f7f39695dece41
enum Foo {
Bar(u32)
}
fn main() {
matches!(todo!(), Foo::BAR(_));
}
The current output is:
error[E0599]: no variant or associated item named `BAR` found for enum `Foo` in the current scope
--> src/main.rs:6:28
|
1 | enum Foo {
| -------- variant or associated item `BAR` not found here
...
6 | matches!(todo!(), Foo::BAR(_));
| ^^^ variant or associated item not found in `Foo`
Ideally the output should include a note suggesting the variant with the same name (but different case):
error[E0599]: no variant or associated item named `BAR` found for enum `Foo` in the current scope
--> src/main.rs:6:28
|
1 | enum Foo {
| -------- variant or associated item `BAR` not found here
...
6 | matches!(todo!(), Foo::BAR(_));
| ^^^ variant or associated item not found in `Foo`
| help: a similarly named variant exists: `Bar`