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

Confusing error message for incorrect struct variant field #19922

Closed
tomjakubowski opened this issue Dec 16, 2014 · 0 comments · Fixed by #20084
Closed

Confusing error message for incorrect struct variant field #19922

tomjakubowski opened this issue Dec 16, 2014 · 0 comments · Fixed by #20084

Comments

@tomjakubowski
Copy link
Contributor

enum Foo {
    Bar { x: () }
}

fn main() {
    let f = Foo::Bar { y: () };
}

Produces:

<anon>:6:24: 6:25 error: structure `Foo` has no field named `y`
<anon>:6     let f = Foo::Bar { y: () };
                                ^
error: aborting due to previous error
playpen: application terminated with error code 101

It would be more helpful to say that the struct variant Foo::Bar has no field named y.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant