Skip to content

Improper use of enum variant gives poor error message #21225

Closed
@mdinger

Description

@mdinger

Similar to #19197 and #17546, this gives a bad error message.
Code:

enum Ty {
    A,
    B(Ty::A),
}

fn main() {}

Error:

<anon>:3:7: 3:12 error: found value name used as a type: DefVariant(DefId { krate: 0u32, node: 4u32 }, DefId { krate: 0u32, node: 5u32 }, false)
<anon>:3     B(Ty::A),
               ^~~~~
playpen: application terminated with error code 101

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lintsP-lowLow priority

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions