Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improper use of enum variant gives poor error message #21225

Closed
mdinger opened this issue Jan 16, 2015 · 2 comments · Fixed by #33696
Closed

Improper use of enum variant gives poor error message #21225

mdinger opened this issue Jan 16, 2015 · 2 comments · Fixed by #33696
Labels
A-diagnostics Area: Messages for errors, warnings, and lints P-low Low priority

Comments

@mdinger
Copy link
Contributor

mdinger commented Jan 16, 2015

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
@sfackler sfackler added the A-diagnostics Area: Messages for errors, warnings, and lints label Jan 16, 2015
@pnkfelix
Copy link
Member

I just ran into this myself. (At least we give you a span to stare at ...)

@pnkfelix
Copy link
Member

triage: P-low

@rust-highfive rust-highfive added the P-low Low priority label May 13, 2015
nham pushed a commit to nham/rust that referenced this issue May 17, 2016
Manishearth added a commit to Manishearth/rust that referenced this issue May 19, 2016
Add regression tests for error message when using enum variant as a type

I'm guessing these were actually fixed with PR rust-lang#27085.

Closes rust-lang#21225
Closes rust-lang#19197
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints P-low Low priority
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants