Skip to content

feat: Update method signature of int_from_ascii#159554

Open
ajtribick wants to merge 1 commit into
rust-lang:mainfrom
ajtribick:int_from_ascii_bytes
Open

feat: Update method signature of int_from_ascii#159554
ajtribick wants to merge 1 commit into
rust-lang:mainfrom
ajtribick:int_from_ascii_bytes

Conversation

@ajtribick

@ajtribick ajtribick commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

Following discussion on Zulip it appears the preference is to change the API for this feature as follows:

// core::num

impl T {
    pub const fn from_ascii_bytes<T>(src: T) -> Result<T, ParseIntError>
    where
        T: [const] AsRef<T> + [const] core::marker::Destruct;

    pub const fn from_ascii_bytes_radix<T>(src: T, radix: u32) -> Result<T, ParseIntError>
    where
        T: [const] AsRef<T> + [const] core::marker::Destruct;
}

and similarly for NonZero<T>.

Reasons behind the change:

This pull request applies this change. The const-ness of these functions is now feature gated behind #143773

@rustbot rustbot added O-apple Operating system: Apple / Darwin (macOS, iOS, tvOS, visionOS, watchOS) S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Jul 19, 2026
@rustbot

rustbot commented Jul 19, 2026

Copy link
Copy Markdown
Collaborator

r? @Mark-Simulacrum

rustbot has assigned @Mark-Simulacrum.
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

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: libs
  • libs expanded to 12 candidates
  • Random selection from 6 candidates

@rust-log-analyzer

This comment has been minimized.

@ajtribick
ajtribick force-pushed the int_from_ascii_bytes branch from 1e6c9d4 to 3d1d65a Compare July 19, 2026 08:48
@rust-log-analyzer

This comment has been minimized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

O-apple Operating system: Apple / Darwin (macOS, iOS, tvOS, visionOS, watchOS) S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. 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.

4 participants