Skip to content
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 cast_signed and cast_unsigned methods for NonZero types #136511

Merged
merged 2 commits into from
Feb 4, 2025

Conversation

joshtriplett
Copy link
Member

Requested in #125882 .

Note that this keeps the same names as the methods currently present on other
integer types. If we want to rename them, we can rename them all at the same
time.

…ing signed type

There was a macro parameter giving signed impls access to the
corresponding unsigned type, but not the other way around.

This will allow implementing methods converting in both directions.
@joshtriplett joshtriplett added the T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. label Feb 3, 2025
@rustbot
Copy link
Collaborator

rustbot commented Feb 3, 2025

r? @scottmcm

rustbot has assigned @scottmcm.
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 the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Feb 3, 2025
@rust-log-analyzer

This comment has been minimized.

@joshtriplett joshtriplett force-pushed the nonzero-cast-signed-unsigned branch from b0ee4f5 to f4a92e3 Compare February 3, 2025 21:18
@joshtriplett
Copy link
Member Author

(Had a local fix I hadn't committed and pushed. Pushed now.)

@dtolnay dtolnay assigned dtolnay and unassigned scottmcm Feb 3, 2025
@dtolnay
Copy link
Member

dtolnay commented Feb 3, 2025

@bors r+

@bors
Copy link
Contributor

bors commented Feb 3, 2025

📌 Commit f4a92e3 has been approved by dtolnay

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Feb 3, 2025
bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 4, 2025
Rollup of 6 pull requests

Successful merges:

 - rust-lang#136398 (add UnsafeCell direct access APIs)
 - rust-lang#136465 (Some `rustc_middle` cleanups)
 - rust-lang#136479 (std::fs: further simplify dirent64 handling)
 - rust-lang#136504 (Fix last compare-mode false negatives in tests)
 - rust-lang#136511 (Add `cast_signed` and `cast_unsigned` methods for `NonZero` types)
 - rust-lang#136518 (Add note about `FnPtr` trait being exposed as public bound)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 5178a36 into rust-lang:master Feb 4, 2025
6 checks passed
@rustbot rustbot added this to the 1.86.0 milestone Feb 4, 2025
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Feb 4, 2025
Rollup merge of rust-lang#136511 - joshtriplett:nonzero-cast-signed-unsigned, r=dtolnay

Add `cast_signed` and `cast_unsigned` methods for `NonZero` types

Requested in rust-lang#125882 .

Note that this keeps the same names as the methods currently present on other
integer types. If we want to rename them, we can rename them all at the same
time.
@joshtriplett joshtriplett deleted the nonzero-cast-signed-unsigned branch February 4, 2025 22:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. 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.

6 participants