Skip to content

Implement operations for Wrapping<T> where Rhs = T #140567

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Kriskras99
Copy link
Contributor

Currently doing the following is not possible:

let n = Wrapping(142usize);
let m = n % 100;

It is however possible to do:

let mut n = Wrapping(142usize);
n %= 100;

In the spirit of Is an RFC required? this seems like an obvious API hole. Therefore I've implemented this without an RFC. I am willing to write an RFC if it is required though.

I could not figure out where/how to implement tests for this, so if someone could please tell me where and how to do that.

Somewhat related issues: #91586 #32463

@rustbot
Copy link
Collaborator

rustbot commented May 1, 2025

r? @thomcc

rustbot has assigned @thomcc.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels May 1, 2025
@cuviper
Copy link
Member

cuviper commented May 2, 2025

r? libs-api

@rustbot rustbot added the T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. label May 2, 2025
@rustbot rustbot assigned dtolnay and unassigned thomcc May 2, 2025
@dtolnay dtolnay removed the T-libs Relevant to the library team, which will review and decide on the PR/issue. label May 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants