-
Notifications
You must be signed in to change notification settings - Fork 514
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
Document behavior of enum when casted to an integer #10
Comments
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 |
@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 😦 |
@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? |
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. |
Heh, alright! Let's keep this in mind when we set up the docs + lang team discussion soon. |
This is now fixed: https://doc.rust-lang.org/nightly/reference/items/enumerations.html |
Consider the following example:
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.
The text was updated successfully, but these errors were encountered: