-
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
Impl {Add,Sub,Mul,Div,Rem,BitXor,BitOr,BitAnd}Assign<$t> for Wrapping<$t> for rust 1.60.0 #93208
Conversation
r? @m-ou-se (rust-highfive has picked a reviewer for you, use r? to override) |
I feel a bit conflicted about these. I agree
This makes me think it might be better if we only do this for the These are just some initial thoughts after thinking about this for a few minutes. I'd love to hear some input from the rest of @rust-lang/libs-api.
In such cases we usually do the FCP on the PR itself. |
Just a fly on the wall here, but I do want to say that I really like this idea. And a reminder to make sure to change the Saturating impls if this changes! |
1f8c36e
to
c36cb04
Compare
This was my initial intention before I thought the other impls would be nice to have as well. Thanks for pointing out the issues. I have updated the commit and I will post a PR to remove the impls from the |
I very much like and support your suggestion of starting with just the Assign traits since they're much easier to reason about here. |
c36cb04
to
9648b31
Compare
We discussed this in today's @rust-lang/libs-api meeting, and given the change to only impl the @rfcbot merge Also, we'd like to be explicit that this should not be taken as precedent for adding methods to do |
Team member @joshtriplett 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. 🔔 |
…mpl, r=joshtriplett Unimpl {Add,Sub,Mul,Div,Rem,BitXor,BitOr,BitAnd}<$t> for Saturating<$t> Tracking issue rust-lang#92354 Analog to 9648b31 rust-lang#93208 reduce `saturating_int_assign_impl` (rust-lang#93208) to: ```rust let mut value = Saturating(2u8); value += 3u8; value -= 1u8; value *= 2u8; value /= 2u8; value %= 2u8; value ^= 255u8; value |= 123u8; value &= 2u8; ``` See rust-lang#93208 (comment)
…mpl, r=joshtriplett Unimpl {Add,Sub,Mul,Div,Rem,BitXor,BitOr,BitAnd}<$t> for Saturating<$t> Tracking issue rust-lang#92354 Analog to 9648b31 rust-lang#93208 reduce `saturating_int_assign_impl` (rust-lang#93208) to: ```rust let mut value = Saturating(2u8); value += 3u8; value -= 1u8; value *= 2u8; value /= 2u8; value %= 2u8; value ^= 255u8; value |= 123u8; value &= 2u8; ``` See rust-lang#93208 (comment)
…mpl, r=joshtriplett Unimpl {Add,Sub,Mul,Div,Rem,BitXor,BitOr,BitAnd}<$t> for Saturating<$t> Tracking issue rust-lang#92354 Analog to 9648b31 rust-lang#93208 reduce `saturating_int_assign_impl` (rust-lang#93208) to: ```rust let mut value = Saturating(2u8); value += 3u8; value -= 1u8; value *= 2u8; value /= 2u8; value %= 2u8; value ^= 255u8; value |= 123u8; value &= 2u8; ``` See rust-lang#93208 (comment)
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. |
@bors r+ |
📌 Commit 14ff58c has been approved by |
…l, r=m-ou-se Impl {Add,Sub,Mul,Div,Rem,BitXor,BitOr,BitAnd}Assign<$t> for Wrapping<$t> for rust 1.60.0 Tracking issue rust-lang#93204 This is about adding basic integer operations to the `Wrapping` type: ```rust let mut value = Wrapping(2u8); value += 3u8; value -= 1u8; value *= 2u8; value /= 2u8; value %= 2u8; value ^= 255u8; value |= 123u8; value &= 2u8; ``` Because this adds stable impls on a stable type, it runs into the following issue if an `#[unstable(...)]` attribute is used: ``` an `#[unstable]` annotation here has no effect note: see issue rust-lang#55436 <rust-lang#55436> for more information ``` This means - if I understood this correctly - the new impls have to be stabilized instantly. Which in turn means, this PR has to kick of an FCP on the tracking issue as well? This impl is analog to 1c0dc18 rust-lang#92356 for the `Saturating` type `@dtolnay` `@Mark-Simulacrum`
Rollup of 13 pull requests Successful merges: - rust-lang#88313 (Make the pre-commit script pre-push instead) - rust-lang#91530 (Suggest 1-tuple parentheses on exprs without existing parens) - rust-lang#92724 (Cleanup c_str.rs) - rust-lang#93208 (Impl {Add,Sub,Mul,Div,Rem,BitXor,BitOr,BitAnd}Assign<$t> for Wrapping<$t> for rust 1.60.0) - rust-lang#93394 (Don't allow {} to refer to implicit captures in format_args.) - rust-lang#93416 (remove `allow_fail` test flag) - rust-lang#93487 (Fix linking stage1 toolchain in `./x.py setup`) - rust-lang#93673 (Linkify sidebar headings for sibling items) - rust-lang#93680 (Drop json::from_reader) - rust-lang#93682 (Update tracking issue for `const_fn_trait_bound`) - rust-lang#93722 (Use shallow clones for submodules managed by rustbuild, not just bootstrap.py) - rust-lang#93723 (Rerun bootstrap's build script when RUSTC changes) - rust-lang#93737 (bootstrap: prefer using '--config' over 'RUST_BOOTSTRAP_CONFIG') Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Tracking issue #93204
This is about adding basic integer operations to the
Wrapping
type:Because this adds stable impls on a stable type, it runs into the following issue if an
#[unstable(...)]
attribute is used:This means - if I understood this correctly - the new impls have to be stabilized instantly.
Which in turn means, this PR has to kick of an FCP on the tracking issue as well?
This impl is analog to 1c0dc18 #92356 for the
Saturating
type @dtolnay @Mark-Simulacrum