You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
error[E0599]: no variant named `mispellable` found for type `Enum` in the current scope
--> src/main.rs:16:5
|
1 | enum Enum { Variant }
| --------- variant `mispellable` not found here
...
16 | Enum::mispellable();
| ^^^^^^^^^^^^^^^^^ variant not found in `Enum`
|
= help: did you mean `misspellable`?
error[E0599]: no variant named `mispellable_trait` found for type `Enum` in the current scope
--> src/main.rs:17:5
|
1 | enum Enum { Variant }
| --------- variant `mispellable_trait` not found here
...
17 | Enum::mispellable_trait();
| ^^^^^^^^^^^^^^^^^^^^^^^ variant not found in `Enum`
error: aborting due to 2 previous errors
I would expect the message to read "variant or associated item" instead of just "variant". The current message is confusing; it could lead users to believe the compiler is expecting to see a variant, and would not allow functions, in the context where the error occurred (note that no spelling suggestion is given if the item is from a trait, furthering the confusion).
error[E0599]: no variant named `mispellable` found for type `Enum` in the current scope
--> file2.rs:16:11
|
1 | enum Enum { Variant }
| --------- variant `mispellable` not found here
...
16 | Enum::mispellable();
| ------^^^^^^^^^^^
| |
| variant not found in `Enum`
| help: did you mean: `misspellable`
error[E0599]: no variant named `mispellable_trait` found for type `Enum` in the current scope
--> file2.rs:17:11
|
1 | enum Enum { Variant }
| --------- variant `mispellable_trait` not found here
...
17 | Enum::mispellable_trait();
| ------^^^^^^^^^^^^^^^^^
| |
| variant not found in `Enum`
Now it is even worse because the suggestion points at the wrong span, so when applied it creates incorrect code :-(
Produces the error messages
I would expect the message to read "variant or associated item" instead of just "variant". The current message is confusing; it could lead users to believe the compiler is expecting to see a variant, and would not allow functions, in the context where the error occurred (note that no spelling suggestion is given if the item is from a trait, furthering the confusion).
Playground
The text was updated successfully, but these errors were encountered: