Skip to content

Tracking Issue for unsigned_signed_diff #126041

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
1 of 3 tasks
davidzeng0 opened this issue Jun 5, 2024 · 2 comments
Open
1 of 3 tasks

Tracking Issue for unsigned_signed_diff #126041

davidzeng0 opened this issue Jun 5, 2024 · 2 comments
Labels
C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.

Comments

@davidzeng0
Copy link
Contributor

davidzeng0 commented Jun 5, 2024

Feature gate: #![feature(unsigned_signed_diff)]

This is a tracking issue for rust-lang/libs-team#381

Public API

impl uX {
        pub const fn overflowing_signed_diff(self, rhs: Self) -> (iX, bool);
	pub const fn saturating_signed_diff(self, rhs: Self) -> iX;
	pub const fn checked_signed_diff(self, rhs: Self) -> Option<iX>;
}

Steps / History

Unresolved Questions

  • None yet.

Footnotes

  1. https://std-dev-guide.rust-lang.org/feature-lifecycle/stabilization.html

@davidzeng0 davidzeng0 added C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. labels Jun 5, 2024
@davidzeng0
Copy link
Contributor Author

For completeness, I could also implement rust-lang/libs-team#381 (comment)

impl iX {
    fn checked_unsigned_diff(self, rhs: Self) -> Option<uX>;
}

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Jul 24, 2024
Implement `unsigned_signed_diff`

<!--
If this PR is related to an unstable feature or an otherwise tracked effort,
please link to the relevant tracking issue here. If you don't know of a related
tracking issue or there are none, feel free to ignore this.

This PR will get automatically assigned to a reviewer. In case you would like
a specific user to review your work, you can assign it to them by using

    r​? <reviewer name>
-->
Implements rust-lang#126041
rust-timer added a commit to rust-lang-ci/rust that referenced this issue Jul 25, 2024
Rollup merge of rust-lang#126042 - davidzeng0:master, r=Amanieu

Implement `unsigned_signed_diff`

<!--
If this PR is related to an unstable feature or an otherwise tracked effort,
please link to the relevant tracking issue here. If you don't know of a related
tracking issue or there are none, feel free to ignore this.

This PR will get automatically assigned to a reviewer. In case you would like
a specific user to review your work, you can assign it to them by using

    r​? <reviewer name>
-->
Implements rust-lang#126041
@pitaj
Copy link
Contributor

pitaj commented Dec 9, 2024

checked_unsigned_diff should be under a separate feature and proposed as a new ACP.

Also, the overflowing, wrapping, saturating, and strict versions of this function are not implemented yet.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

2 participants