-
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 LowerExp and UpperExp implementations to NonZero #131377
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @scottmcm (or someone else) some time within the next two weeks. Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (
|
This comment has been minimized.
This comment has been minimized.
library/core/src/num/nonzero.rs
Outdated
@@ -110,8 +110,8 @@ impl_zeroable_primitive!( | |||
pub struct NonZero<T: ZeroablePrimitive>(T::NonZeroInner); | |||
|
|||
macro_rules! impl_nonzero_fmt { | |||
($Trait:ident) => { | |||
#[stable(feature = "nonzero", since = "1.28.0")] | |||
($Trait:ident, $Feature:literal, $Since:literal) => { |
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.
hmm, would it perhaps make sense to use a :meta
matcher here?
That plus a repeat in the macro could allow something like
impl_nonzero_fmt!{
#[stable(feature = "nonzero", since = "1.28.0")]
Debug
#[stable(feature = "nonzero", since = "1.28.0")]
Display
#[stable(feature = "nonzero_fmt_exp", since = "CURRENT_RUSTC_VERSION")]
LowerExp
}
which I think would be nice to make it more obvious to people rg
ing and such what the attributes are on.
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.
Updated the macro
While you're getting CI happy, Then please squash the commits and |
Mark the new fmt impls with the correct rust version Clean up the fmt macro and format the tests
feb9ac0
to
fead1d5
Compare
Applied feedback and squashed commits, please |
@rfcbot merge
|
Team member @m-ou-se has proposed to merge this. The next step is review by the rest of the tagged team members: No concerns currently listed. Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up! See this document for info about what commands tagged team members can give me. |
🔔 This is now entering its final comment period, as per the review above. 🔔 |
The final comment period, with a disposition to merge, as per the review above, is now complete. As the automated representative of the governance process, I would like to thank the author for their work and everyone else who contributed. This will be merged soon. |
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.
Thanks!
@bors r+ |
Add LowerExp and UpperExp implementations to NonZero Adds `LowerExp` and `UpperExp` trait implementations to `NonZero`, as discussed in rust-lang/libs-team#458. I had to modify the macro to mark the new impls with a different rust version. Let me know if this is the right way to do it (first timer here!)
…kingjubilee Rollup of 15 pull requests Successful merges: - rust-lang#129329 (Implement `From<&mut {slice}>` for `Box/Rc/Arc<{slice}>`) - rust-lang#131377 (Add LowerExp and UpperExp implementations to NonZero) - rust-lang#132275 (Register `~const` preds for `Deref` adjustments in HIR typeck) - rust-lang#132393 (Docs: added brief colon explanation) - rust-lang#132437 (coverage: Regression test for inlining into an uninstrumented crate) - rust-lang#132499 (unicode_data.rs: show command for generating file) - rust-lang#132503 (better test for const HashMap; remove const_hash leftovers) - rust-lang#132520 (NFC add known bug nr to test) - rust-lang#132522 (make codegen help output more consistent) - rust-lang#132523 (Added regression test for generics index out of bounds) - rust-lang#132528 (Use `*_opt` typeck results fns to not ICE in fallback suggestion) - rust-lang#132537 (PassWrapper: adapt for llvm/llvm-project@5445edb5d) - rust-lang#132540 (Do not format generic consts) - rust-lang#132543 (add and update some crashtests) - rust-lang#132550 (compiler: Continue introducing rustc_abi to the compiler) r? `@ghost` `@rustbot` modify labels: rollup
Add LowerExp and UpperExp implementations to NonZero Adds `LowerExp` and `UpperExp` trait implementations to `NonZero`, as discussed in rust-lang/libs-team#458. I had to modify the macro to mark the new impls with a different rust version. Let me know if this is the right way to do it (first timer here!)
…iaskrgr Rollup of 16 pull requests Successful merges: - rust-lang#129329 (Implement `From<&mut {slice}>` for `Box/Rc/Arc<{slice}>`) - rust-lang#131377 (Add LowerExp and UpperExp implementations to NonZero) - rust-lang#132393 (Docs: added brief colon explanation) - rust-lang#132437 (coverage: Regression test for inlining into an uninstrumented crate) - rust-lang#132499 (unicode_data.rs: show command for generating file) - rust-lang#132503 (better test for const HashMap; remove const_hash leftovers) - rust-lang#132511 (stabilize const_arguments_as_str) - rust-lang#132520 (NFC add known bug nr to test) - rust-lang#132522 (make codegen help output more consistent) - rust-lang#132523 (Added regression test for generics index out of bounds) - rust-lang#132528 (Use `*_opt` typeck results fns to not ICE in fallback suggestion) - rust-lang#132537 (PassWrapper: adapt for llvm/llvm-project@5445edb5d) - rust-lang#132540 (Do not format generic consts) - rust-lang#132543 (add and update some crashtests) - rust-lang#132544 (Use backticks instead of single quotes for library feature names in diagnostics) - rust-lang#132550 (compiler: Continue introducing rustc_abi to the compiler) r? `@ghost` `@rustbot` modify labels: rollup
…iaskrgr Rollup of 15 pull requests Successful merges: - rust-lang#129329 (Implement `From<&mut {slice}>` for `Box/Rc/Arc<{slice}>`) - rust-lang#131377 (Add LowerExp and UpperExp implementations to NonZero) - rust-lang#132393 (Docs: added brief colon explanation) - rust-lang#132437 (coverage: Regression test for inlining into an uninstrumented crate) - rust-lang#132499 (unicode_data.rs: show command for generating file) - rust-lang#132503 (better test for const HashMap; remove const_hash leftovers) - rust-lang#132511 (stabilize const_arguments_as_str) - rust-lang#132520 (NFC add known bug nr to test) - rust-lang#132522 (make codegen help output more consistent) - rust-lang#132523 (Added regression test for generics index out of bounds) - rust-lang#132528 (Use `*_opt` typeck results fns to not ICE in fallback suggestion) - rust-lang#132537 (PassWrapper: adapt for llvm/llvm-project@5445edb5d) - rust-lang#132540 (Do not format generic consts) - rust-lang#132543 (add and update some crashtests) - rust-lang#132550 (compiler: Continue introducing rustc_abi to the compiler) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#131377 - rick-de-water:nonzero-exp, r=dtolnay Add LowerExp and UpperExp implementations to NonZero Adds `LowerExp` and `UpperExp` trait implementations to `NonZero`, as discussed in rust-lang/libs-team#458. I had to modify the macro to mark the new impls with a different rust version. Let me know if this is the right way to do it (first timer here!)
Adds
LowerExp
andUpperExp
trait implementations toNonZero
, as discussed in rust-lang/libs-team#458.I had to modify the macro to mark the new impls with a different rust version. Let me know if this is the right way to do it (first timer here!)