-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
lint unportable clike enum discriminants #710
Conversation
/// **Example:** #[repr(usize)] enum NonPortable { X = 0x1_0000_0000, Y = 0 } | ||
declare_lint! { | ||
pub ENUM_CLIKE_UNPORTABLE_VARIANT, Warn, | ||
"finds enums where all variants share a prefix/postfix" |
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.
the description is wrong
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.
copypasta
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.
fixed
addressed comments |
use rustc::middle::ty; | ||
use utils::span_lint; | ||
|
||
/// **What it does:** C-like enums that are `repr(isize/usize)`` and have values that don't fit into an `i32` |
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.
There is one quote to many after repr(isize/usize)
and other wiki entries end with a point 😄
addressed comments |
rebased |
lint unportable clike enum discriminants
Thanks! 👍 |
some context here: rust-lang/rust#24290
in case 16-bit targets become a thing, we should adjust the lint.