-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Incorrect error message when accessing private field of union #63976
Comments
Can I pick this up if no-one is working on this? |
@sam09 go ahead! You need to use rust/src/librustc_typeck/check/expr.rs Lines 1394 to 1402 in 5a6d801
to get whether it is a struct or union using |
Thanks @estebank . |
@sam09 |
When accessing private field of union, do not misidentify it as a struct Fix incorrect error message when accessing private field of union. Fixes rust-lang#63976.
When accessing private field of union, do not misidentify it as a struct Fix incorrect error message when accessing private field of union. Fixes #63976.
(Playground)
Errors:
Notice how it says "struct" when it should say "union".
cc @estebank this looks like low-hanging fruit
The text was updated successfully, but these errors were encountered: