You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Document behavior of enum when casted to an integer #10
The current behavior is that Foo members get casted to an increasing sequence starting from 0. Although that seems to be the most reasonable default, it should be documented to make clear that it won't be changed in the future.
@aturon so, here's an interesting wrinkle. We were talking about getting the lang team and the docs team together to tackle issues like this one, but given this is in the nursery and not rust-lang, I can't cc @rust-lang/lang 😦
Was there some particular "graduation" point we had in mind?
I said "hey @alexcrichton ! Should this go in the nursery or rust-lang. I don't care." He shugged. So we asked @brson. He said "Eh given its level of polish let's put it in the nursery", to which alex and I said 🆒 .
So, it was basically a coinflip, and we didn't have any particular criteria set up.
Activity
frewsxcv commentedon Mar 13, 2017
Somewhat related, the book has a section on casting semantics that maybe should be copied/moved into the reference:
https://doc.rust-lang.org/book/casting-between-types.html
Though, it doesn't look like there's much there on enum casting
steveklabnik commentedon Mar 13, 2017
@aturon so, here's an interesting wrinkle. We were talking about getting the lang team and the docs team together to tackle issues like this one, but given this is in the nursery and not rust-lang, I can't cc @rust-lang/lang 😦
aturon commentedon Mar 13, 2017
@steveklabnik Whelp! I guess there are basically two options here:
I'm not sure what the status of the latter is. Was there some particular "graduation" point we had in mind?
steveklabnik commentedon Mar 13, 2017
I said "hey @alexcrichton ! Should this go in the nursery or rust-lang. I don't care." He shugged. So we asked @brson. He said "Eh given its level of polish let's put it in the nursery", to which alex and I said 🆒 .
So, it was basically a coinflip, and we didn't have any particular criteria set up.
aturon commentedon Mar 13, 2017
@steveklabnik
Heh, alright! Let's keep this in mind when we set up the docs + lang team discussion soon.
alercah commentedon Jan 2, 2018
This is now fixed: https://doc.rust-lang.org/nightly/reference/items/enumerations.html
frewsxcv commentedon Jan 3, 2018
yep! looks like @Havvy took care of this in #156 🎉