feat: Update method signature of int_from_ascii#159554
Open
ajtribick wants to merge 1 commit into
Open
Conversation
Collaborator
|
rustbot has assigned @Mark-Simulacrum. Use Why was this reviewer chosen?The reviewer was selected based on:
|
This comment has been minimized.
This comment has been minimized.
ajtribick
force-pushed
the
int_from_ascii_bytes
branch
from
July 19, 2026 08:48
1e6c9d4 to
3d1d65a
Compare
This comment has been minimized.
This comment has been minimized.
ajtribick
force-pushed
the
int_from_ascii_bytes
branch
from
July 19, 2026 09:22
3d1d65a to
0bd28ea
Compare
8 tasks
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
Member
|
@bors r+ |
Contributor
JonathanBrouwer
added a commit
to JonathanBrouwer/rust
that referenced
this pull request
Jul 27, 2026
…Mark-Simulacrum feat: Update method signature of int_from_ascii * Tracking issue: rust-lang#134821 Following [discussion on Zulip](https://rust-lang.zulipchat.com/#narrow/channel/327149-t-libs-api.2Fapi-changes/topic/How.20to.20proceed.20with.20int_from_ascii/with/611508226) it appears the preference is to change the API for this feature as follows: ```rust // core::num impl X { pub const fn from_ascii_bytes<T>(src: T) -> Result<X, ParseIntError> where T: [const] AsRef<[u8]> + [const] core::marker::Destruct; pub const fn from_ascii_bytes_radix<T>(src: T, radix: u32) -> Result<X, ParseIntError> where T: [const] AsRef<[u8]> + [const] core::marker::Destruct; } ``` and similarly for `NonZero<X>`. Reasons behind the change: * Future-proof the naming convention for future string-like types * Support the upcoming `ByteStr`/`ByteString` types: rust-lang#134915 This pull request applies this change. The const-ness of these functions is now feature gated behind rust-lang#143773
rust-bors Bot
pushed a commit
that referenced
this pull request
Jul 27, 2026
…uwer Rollup of 8 pull requests Successful merges: - #159085 (Fix decoding attributes of `SyntheticCoroutineBody`) - #159554 (feat: Update method signature of int_from_ascii) - #159637 (Some place analysis tweaks) - #159961 (sanitize_standard_fds: Miri supports poll now) - #159967 (rustc_target: callconv: mips64: Return structs with single f128 in FPRs) - #159253 (Add suggestions for using `#[export_name]` instead of `#[link_name]` on static) - #159840 (Fix opaque type ICE in late lints under the next-generation trait solver) - #159956 (Fix observable intermediate state in `thread::add_spawn_hook`)
rust-bors Bot
pushed a commit
that referenced
this pull request
Jul 27, 2026
…uwer Rollup of 8 pull requests Successful merges: - #159085 (Fix decoding attributes of `SyntheticCoroutineBody`) - #159554 (feat: Update method signature of int_from_ascii) - #159637 (Some place analysis tweaks) - #159961 (sanitize_standard_fds: Miri supports poll now) - #159967 (rustc_target: callconv: mips64: Return structs with single f128 in FPRs) - #159253 (Add suggestions for using `#[export_name]` instead of `#[link_name]` on static) - #159840 (Fix opaque type ICE in late lints under the next-generation trait solver) - #159956 (Fix observable intermediate state in `thread::add_spawn_hook`)
JonathanBrouwer
added a commit
to JonathanBrouwer/rust
that referenced
this pull request
Jul 27, 2026
…Mark-Simulacrum feat: Update method signature of int_from_ascii * Tracking issue: rust-lang#134821 Following [discussion on Zulip](https://rust-lang.zulipchat.com/#narrow/channel/327149-t-libs-api.2Fapi-changes/topic/How.20to.20proceed.20with.20int_from_ascii/with/611508226) it appears the preference is to change the API for this feature as follows: ```rust // core::num impl X { pub const fn from_ascii_bytes<T>(src: T) -> Result<X, ParseIntError> where T: [const] AsRef<[u8]> + [const] core::marker::Destruct; pub const fn from_ascii_bytes_radix<T>(src: T, radix: u32) -> Result<X, ParseIntError> where T: [const] AsRef<[u8]> + [const] core::marker::Destruct; } ``` and similarly for `NonZero<X>`. Reasons behind the change: * Future-proof the naming convention for future string-like types * Support the upcoming `ByteStr`/`ByteString` types: rust-lang#134915 This pull request applies this change. The const-ness of these functions is now feature gated behind rust-lang#143773
JonathanBrouwer
added a commit
to JonathanBrouwer/rust
that referenced
this pull request
Jul 27, 2026
…Mark-Simulacrum feat: Update method signature of int_from_ascii * Tracking issue: rust-lang#134821 Following [discussion on Zulip](https://rust-lang.zulipchat.com/#narrow/channel/327149-t-libs-api.2Fapi-changes/topic/How.20to.20proceed.20with.20int_from_ascii/with/611508226) it appears the preference is to change the API for this feature as follows: ```rust // core::num impl X { pub const fn from_ascii_bytes<T>(src: T) -> Result<X, ParseIntError> where T: [const] AsRef<[u8]> + [const] core::marker::Destruct; pub const fn from_ascii_bytes_radix<T>(src: T, radix: u32) -> Result<X, ParseIntError> where T: [const] AsRef<[u8]> + [const] core::marker::Destruct; } ``` and similarly for `NonZero<X>`. Reasons behind the change: * Future-proof the naming convention for future string-like types * Support the upcoming `ByteStr`/`ByteString` types: rust-lang#134915 This pull request applies this change. The const-ness of these functions is now feature gated behind rust-lang#143773
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
int_from_ascii#134821Following discussion on Zulip it appears the preference is to change the API for this feature as follows:
and similarly for
NonZero<X>.Reasons behind the change:
ByteStr/ByteStringtypes: Tracking Issue for ByteStr/ByteString #134915This pull request applies this change. The const-ness of these functions is now feature gated behind #143773