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

core: add From<core::ascii::Char> implementations #120311

Merged
merged 2 commits into from
Jan 27, 2024
Merged

Conversation

mina86
Copy link
Contributor

@mina86 mina86 commented Jan 24, 2024

Introduce From<core::ascii::Char> implementations for all unsigned
numeric types and char. This matches the API of char type.

Issue: #110998

@rustbot
Copy link
Collaborator

rustbot commented Jan 24, 2024

r? @cuviper

(rustbot has picked a reviewer for you, use r? to override)

@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 Jan 24, 2024
@mina86
Copy link
Contributor Author

mina86 commented Jan 24, 2024

Context: #120219 (comment)

@rust-log-analyzer

This comment has been minimized.

@scottmcm
Copy link
Member

The PR build failures are because you'll need to bless various UI tests, since more Froms change the error messages in some places.

@rustbot author

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jan 24, 2024
@joshtriplett
Copy link
Member

@scottmcm Do you consider the availability of the const to_u8 and to_char methods blocking (and want them kept for now), or are you fine with this PR removing them for now?

@scottmcm
Copy link
Member

@joshtriplett I think as long as there's a way to get the u8 in const, I can tolerate it either way, and will leave it up to libs-api.

(If that's as u8 that's fine, but I wouldn't want to couple potential stabilization of this to needing stabilization of impl const From. I also think that a method for getting the specific representation type is actually good, since to me the type might as well also be i16: From<ascii::Char> and such.)

Introduce `From<core::ascii::char>` implementations for all unsigned
numeric types and `char`.  This matches the API of `char` type.

Issue: rust-lang#110998
@mina86 mina86 changed the title core: replace ascii::char::to_{u8,char} with From impls core: add From<core::ascii::char> implementations Jan 25, 2024
@rust-log-analyzer

This comment has been minimized.

@mina86 mina86 changed the title core: add From<core::ascii::char> implementations core: add From<core::ascii::Char> implementations Jan 25, 2024
@mina86
Copy link
Contributor Author

mina86 commented Jan 26, 2024

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jan 26, 2024
@cuviper
Copy link
Member

cuviper commented Jan 26, 2024

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Jan 26, 2024

📌 Commit c4208fa has been approved by cuviper

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 Jan 26, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 27, 2024
…iaskrgr

Rollup of 12 pull requests

Successful merges:

 - rust-lang#103522 (stabilise array methods)
 - rust-lang#113489 (impl `From<&[T; N]>` for `Cow<[T]>`)
 - rust-lang#119342 (Emit suggestion when trying to write exclusive ranges as `..<`)
 - rust-lang#119562 (Rename `pointer` field on `Pin`)
 - rust-lang#119800 (Document `rustc_index::vec::IndexVec`)
 - rust-lang#120205 (std: make `HEAP` initializer never inline)
 - rust-lang#120277 (Normalize field types before checking validity)
 - rust-lang#120311 (core: add `From<core::ascii::Char>` implementations)
 - rust-lang#120366 (mark a doctest with UB as no_run)
 - rust-lang#120378 (always normalize `LoweredTy` in the new solver)
 - rust-lang#120382 (Classify closure arguments in refutable pattern in argument error)
 - rust-lang#120389 (Add fmease to the compiler review rotation)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 411b41e into rust-lang:master Jan 27, 2024
11 checks passed
@rustbot rustbot added this to the 1.77.0 milestone Jan 27, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Jan 27, 2024
Rollup merge of rust-lang#120311 - mina86:h, r=cuviper

core: add `From<core::ascii::Char>` implementations

Introduce `From<core::ascii::Char>` implementations for all unsigned
numeric types and `char`.  This matches the API of `char` type.

Issue: rust-lang#110998
@mina86 mina86 deleted the h branch January 27, 2024 06:30
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 Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants