-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Change E0451 to output proper indices for tuple-struct fields. #31721
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
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @nrc (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
Huh, this is interesting; pretty ambivalent about this. On one hand I see the dissonance between this and the tuple access syntax, on the other hand English. Hm. |
@bors r+ rollup thought a bit more about this. As long as it isn't saying "zeroeth" and "first" it should be fine. thanks! |
📌 Commit 94499e3 has been approved by |
@@ -710,7 +710,7 @@ impl<'a, 'tcx> PrivacyVisitor<'a, 'tcx> { | |||
NamedField(name) => format!("field `{}` of {} is private", | |||
name, struct_desc), | |||
UnnamedField(idx) => format!("field #{} of {} is private", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This use of #
always irks me - is it an american thing? I thought using '#' for 'number' went out of fashion in about 1900. The error message would be just as good without the '#', IMO.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
More so when describing the fields as 0-indexed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm inclined to agree about the error message itself -- it would probably look nicer just as "field X
of Y is private". I figure that such a change would be better in another PR, but I could add it to this one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another PR is fine
…anishearth Fixes rust-lang#31706 Also fixes a phrasing error in the diagnostic.
Fixes #31706
Also fixes a phrasing error in the diagnostic.