Uh oh!
There was an error while loading. Please reload this page.
New error codes - #42614
Conversation
rust-highfive
commented
Jun 12, 2017
r? @pnkfelix (rust_highfive has picked a reviewer for you, use r? to override) |
There was a problem hiding this comment.
Should be "Attempted to access a private field on a tuple-struct."
There was a problem hiding this comment.
Instead "add a getter function to keep the field private but allow for accessing its value:".
There was a problem hiding this comment.
I'd suggest using "n" here instead of "x" as "n" is commonly used for referring to integer values.
There was a problem hiding this comment.
Instead "If you want to index into an array, use [] instead:"
There was a problem hiding this comment.
Too many commas and incorrect conjugation. Instead "However, if you wanted to access a field of a struct check that the field name is spelled correctly."
There was a problem hiding this comment.
Instead "Attempted to access a private field on a struct."
There was a problem hiding this comment.
Instead: "1) Set the field public:"
I don't like the double-colons on this line.
There was a problem hiding this comment.
Instead "2) Add a getter function:"
There was a problem hiding this comment.
I suggest instead: "attempted to access tuple index {} on type {}, but the type is not a tuple or tuple struct"
9c9d0a0 to
8063e12CompareGuillaumeGomez
commented
Jun 12, 2017
@Susurrus: Thanks a lot for this review! Updated. :) |
There was a problem hiding this comment.
index into a slice
would this be more accurate?
There was a problem hiding this comment.
I wanted to include both Vec and slices.
There was a problem hiding this comment.
In the context of Rust, when I see the term "array" I often think of fixed-length arrays [T; n]. But I don't have a better term on hand that covers the cases here, so this is fine with me.
There was a problem hiding this comment.
If you want to access a field of a struct, ensure the field's name is spelled correctly
this sounds better to me, but i don't feel strongly
8063e12 to
0a2d5dcComparebors
commented
Jun 14, 2017
☔ The latest upstream changes (presumably #42644) made this pull request unmergeable. Please resolve the merge conflicts. |
0a2d5dc to
ee60064CompareGuillaumeGomez
commented
Jun 15, 2017
Rebased. |
Would it be worth combining E0611 (private field access, tuple struct) and E0616 (private field access, traditional struct)? From the user's perspective, it's the same error, just in different situations. (EDIT: For any infra team members who see this in a week, I believe imperio just left for a 10-day vacation, so updates on this will likely wait until he's come back from that.) |
alexcrichton
commented
Jun 22, 2017
ping @pnkfelix, I think this is ready for a re-review |
pnkfelix
commented
Jun 22, 2017
@bors r+ |
bors
commented
Jun 22, 2017
📌 Commit ee60064 has been approved by |
bors
commented
Jun 22, 2017
New error codes Part of #42229. cc @Susurrus@frewsxcv@QuietMisdreavus
bors
commented
Jun 23, 2017
☀️ Test successful - status-appveyor, status-travis |
Part of #42229.
cc @Susurrus@frewsxcv@QuietMisdreavus