-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Add PartialEq and PartialOrd for NonZeroInt to Int #70855
Conversation
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
r? @KodrAus |
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
These appear to be |
@Lucretiel did you run tidy ? |
Huh, I thought I ran rustfmt already. Published fixes. |
r? @Amanieu |
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.
I'd also like to implement PartialEq for Int, but I wasn't sure what the implications were for implementing traits on primitive types like that.
I think this is fine.
@@ -110,6 +111,20 @@ assert_eq!(size_of::<Option<core::num::", stringify!($Ty), ">>(), size_of::<", s | |||
} | |||
} | |||
|
|||
#[unstable(feature = "nonzero_cmp_to_int", issue = "70855")] |
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.
Trait implementations are always insta-stable. Use #[stable]
instead.
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.
I updated to stable; it wants a "since" attribute
☔ The latest upstream changes (presumably #71556) made this pull request unmergeable. Please resolve the merge conflicts. |
Ping from triage: |
Ping from Triage: Closing due to inactivity. Please re-open with any updates and conflicts resolved. Thank you for the PR. @Lucretiel |
Updated this branch! Conflicts resolved, tidy passing. Not sure how to account for making the trait insta-stable, I'll need some guidance on that. |
You'll need to reopen the PR or open a new one. For the stability attribute just mark it as since 1.45.0. We'll need to run this through FCP for stabilization. |
I don't have a "reopen" button available to me; maybe @joelpalmer? |
Opened #72405 instead |
Propose adding
PartialEq
andPartialOrd
to theNonZeroInt
types to compare to their inner types. Seems like a pretty obvious change, but I'm obviously open to any feedback or suggestions.I'd also like to implement
PartialEq<NonZeroInt> for Int
, but I wasn't sure what the implications were for implementing traits on primitive types like that.