-
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
Add 12 num::NonZero* types for primitive integers, deprecate core::nonzero #48265
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @aidanhs (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
bb36499
to
fc8d2e6
Compare
r? @KodrAus |
c819a2e
to
593b332
Compare
Marking as blocked by rust-lang/rfcs#2307, the RFC has not been accepted yet. |
☔ The latest upstream changes (presumably #48520) made this pull request unmergeable. Please resolve the merge conflicts. |
fe39656
to
a7ca6b2
Compare
@@ -20,7 +20,7 @@ where | |||
|
|||
// @has no_redundancy/struct.Outer.html | |||
// @has - '//*[@id="synthetic-implementations-list"]/*[@class="impl"]/*/code' "impl<T> Send for \ | |||
// Outer<T> where T: Copy + Send" | |||
// Outer<T> where T: Send + Copy" |
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 ptr::Shared
removal makes this test fail unless I make this change. I have no idea why.
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.
Filed #49123
☔ The latest upstream changes (presumably #47630) made this pull request unmergeable. Please resolve the merge conflicts. |
@@ -62,14 +63,11 @@ impl_zeroable_for_integer_types! { | |||
/// NULL or 0 that might allow certain optimizations. | |||
#[lang = "non_zero"] | |||
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Debug, Hash)] | |||
pub struct NonZero<T: Zeroable>(T); | |||
pub struct NonZero<T: Zeroable>(pub(crate) T); |
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.
Is there a reason we need to make this pub(crate)
instead of using the new_unchecked
and get
methods?
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.
This is in anticipation for later making this module private and reducing it to its bare minimum (the lang item) SimonSapin#1
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 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.
Ah gotcha. I missed that part in the RFC 👍
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.
This looks good to me! Thanks @SimonSapin
@bors r+ |
📌 Commit a23f685 has been approved by |
⌛ Testing commit a23f685 with merge d16d565cf25d417110f72a4d3181fe111312fa82... |
💔 Test failed - status-travis |
@bors: retry
|
Add 12 num::NonZero* types for primitive integers, deprecate core::nonzero RFC: rust-lang/rfcs#2307 Tracking issue: ~~rust-lang#27730 rust-lang#49137 Fixes rust-lang#27730
Add 12 num::NonZero* types for primitive integers, deprecate core::nonzero RFC: rust-lang/rfcs#2307 Tracking issue: ~~rust-lang#27730 rust-lang#49137 Fixes rust-lang#27730
RFC: rust-lang/rfcs#2307
Tracking issue:
#27730#49137Fixes #27730