-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
Use 64-bit integers to represent discriminants #8504
Conversation
This would have failed on 32-to-64-bit cross-compiles.
cc @kemurphy |
0x1717171717171717 | ||
}; | ||
assert_eq!(expected, V as u64); | ||
assert_eq!(expected, V as u64); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are the above two lines supposed to be identical?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops. No. One of those is supposed to be C
. Nice catch; thanks.
|
Current status: aforementioned test breakage was a libuv bug (which affected my desktop but not the bots, or other less chaotic Linux systems), and my new version conflicts with #8546 so I'll wait for that to land before re-pushing. |
I'm just going to close this so it's not a source of confusion until the changes it conflicts with land. |
…n, r=flip1995 Add lint to detect `allow` attributes without reason I was considering putting this lint into the pedantic group. However, that would result in countless warnings for existing projects. Having it in restriction also seems good to me 🙃 (And now I need sleep 💤 ) --- changelog: New lint [`allow_lint_without_reason`] (Requires the `lint_reasons` feature) Closes: rust-lang/rust-clippy#8502
This is in preparation for making discriminants not always be int (#1647), but it also makes compiles for a 64-bit target not behave differently with respect to how many bits of discriminants are preserved depending on the build host's word size, which is a nice property to have.
We may want to standardize how to abbreviate "discriminant" in a followup change.