-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Clarify the semantics of enum discriminants #31772
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
@pnkfelix "specify"? |
@apasel422 works for me |
The error explanation is somewhat misleading, we actually use the smallest valid integer type (with a preference for unsigned integers) when no We probably shouldn't replicate that. |
@Aatch Are you suggesting to fix |
@nodakai it's the same issue here as in |
@Aatch So, what should I do? Are you suggesting me to fix |
@nodakai I think I may have been misremembering your wording earlier, confusing it with the |
I would agree with "specify" r=me after |
Extended the scope of the patch to include Avoided the word "assign" in referring to enum declarations because "assign" often implies an update of a mutable state. |
@bors: r+ rollup Thanks! |
📌 Commit 969d027 has been approved by |
Clarify the semantics of enum discriminants cf. https://doc.rust-lang.org/error-index.html#E0082 > The default type for enum discriminants is isize, but it can be adjusted by adding the repr attribute to the enum declaration. It would be great if anyone could check my English.
Clarify the semantics of enum discriminants cf. https://doc.rust-lang.org/error-index.html#E0082 > The default type for enum discriminants is isize, but it can be adjusted by adding the repr attribute to the enum declaration. It would be great if anyone could check my English.
cf. https://doc.rust-lang.org/error-index.html#E0082
It would be great if anyone could check my English.