Uh oh!
There was an error while loading. Please reload this page.
Create more error codes - #42519
Conversation
rust-highfive
commented
Jun 7, 2017
r? @pnkfelix (rust_highfive has picked a reviewer for you, use r? to override) |
aidanhs
commented
Jun 8, 2017
Presumably meant to be |
9bedfa8 to
341f827CompareGuillaumeGomez
commented
Jun 8, 2017
Absolutely! |
Fixed btw. |
There was a problem hiding this comment.
Should read: "Only primitive types can be cast into each other"
There was a problem hiding this comment.
Same as above.
I'm thinking the first line should read more like "Casting between non-primitive types" or something instead of just saying "invalid cast" and then having to explain every time that a valid cast is just between primitives.
There was a problem hiding this comment.
"DST" instead of "They" at the start to be more clear.
There was a problem hiding this comment.
Any way to remove "non-scalar" from this? Your expanded error descriptions you added above use the term "primitive types", can that be used everywhere for all these errors instead of "non-scalar"? I never see "non-scalar" in any docs anywhere.
There was a problem hiding this comment.
Hum, do you have a better formulation?
There was a problem hiding this comment.
"non-primitive cast"? Primitive is a word people will/should be exposed to when using rust. I don't think "non-scalar" appears much in the docs (though I haven't searched, but I've never seen it).
341f827 to
c1791baCompareGuillaumeGomez
commented
Jun 9, 2017
Updated. |
There was a problem hiding this comment.
This reads awkwardly. I suggest "was attempted on a type other than u8".
This error does bring up the question of why are only u8s castable to chars? I thought a char in rust was 4 bytes?
There was a problem hiding this comment.
I think it comes straight from the C language. In C, char are 8 bits and supposed to represent ascii characters.
There was a problem hiding this comment.
Maybe instead be more clear what simple means: "Thin pointers are purely a reference to a memory address"
There was a problem hiding this comment.
This brings up the question of why? What extra information is required to be stored that makes a fat pointer a necessity. Adding a sentence or clarifying why just a pure memory address would be useful here (I'm not even actually sure of why fat pointers are necessary).
There was a problem hiding this comment.
So, the explanation for you too (so nice of me haha 😉 ). Let's take a slice: you need in addition of the memory address, the size of the slice.
That's actually a good explanation, I'll add it. :)
c1791ba to
69cdf76CompareGuillaumeGomez
commented
Jun 9, 2017
Updated. |
e18afb3 to
c70c37aComparec70c37a to
b0016caCompareGuillaumeGomez
commented
Jun 11, 2017
Updated. |
There was a problem hiding this comment.
There are a few instances of "casted" used here when I think the past tense of "cast" is actually just "cast".
There was a problem hiding this comment.
Damn irregular verbs! :p
b0016ca to
b9804adCompareGuillaumeGomez
commented
Jun 11, 2017
Fixed the verbing error. |
bors
commented
Jun 12, 2017
☔ The latest upstream changes (presumably #42585) made this pull request unmergeable. Please resolve the merge conflicts. |
b9804ad to
851fbbcCompareGuillaumeGomez
commented
Jun 12, 2017
And re-updated. cc @Susurrus |
Susurrus
commented
Jun 12, 2017
LGTM |
GuillaumeGomez
commented
Jun 12, 2017
@bors: r+ |
bors
commented
Jun 12, 2017
📌 Commit 851fbbc has been approved by |
frewsxcv
commented
Jun 12, 2017
@bors r- who is the reviewer? |
GuillaumeGomez
commented
Jun 12, 2017
r? @frewsxcv |
There was a problem hiding this comment.
I don't know if "dynamically sized types" needs to be capitalized here, but not a big deal
There was a problem hiding this comment.
I agree, it shouldn't be capitalized.
There was a problem hiding this comment.
It was to make easier the understanding of DST.
There was a problem hiding this comment.
As long as this is the catch-all error message for invalid casting, I'm slightly leaning towards listing all the different casting rules. Maybe we could just link to the book? Other error messages seem to link to the book/reference
GuillaumeGomez
commented
Jun 15, 2017
So, I added an url to the rust reference to every cast rules in all long error explanation. Do you think I need to update something else? |
QuietMisdreavus
commented
Jun 15, 2017
I still think it would be better to rephrase the explain text for E0606 to state something like "incompatible cast" instead of talking about "non-primitive types". Especially now that it's linking to the list of "valid casts", we can just call it "invalid" or "incompatible" or something like that. |
bors
commented
Jun 16, 2017
☔ The latest upstream changes (presumably #42568) made this pull request unmergeable. Please resolve the merge conflicts. |
7c12bbb to
9137153CompareGuillaumeGomez
commented
Jun 24, 2017
I slightly updated the long error explanation. Does it seem good like this? |
QuietMisdreavus
commented
Jun 24, 2017
It looks like the links to the reference got taken out in the last update? I'd rather leave those in. |
GuillaumeGomez
commented
Jun 25, 2017
Updated. |
QuietMisdreavus
commented
Jun 26, 2017
Travis looks stuck on one builder, but the ALLOW_PR build passed, so that's good enough for me. @bors r+ Thanks so much! |
bors
commented
Jun 26, 2017
📌 Commit bcf0d60 has been approved by |
frewsxcv
commented
Jun 27, 2017
@bors rollup |
…des, r=QuietMisdreavus Create more error codes Fixesrust-lang#31174. Part of rust-lang#42229. cc @Susurrus
Remove err methods To be merged after #42519. cc @Susurrus@QuietMisdreavus
Fixes#31174.
Part of #42229.
cc @Susurrus