Defining an associated constant with the same name as an enum value does not produce an error #128462
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Code
Current output
Desired output
Rationale and extra context
Maybe this isn't a bug, and I just don't understand the purpose for this behavior. It seems to me the
associated constant
cannot be constructed, and the compiler should produce a specific error or at least a warning for it.I imagine the current consensus might be that the warning:
Would constitute an answer to the problem we see here, but it also doesn't specifically mention that the two identifiers are conflicting.
Other cases
No response
Rust Version
Anything else?
No response
The text was updated successfully, but these errors were encountered: