-
Notifications
You must be signed in to change notification settings - Fork 22
Closed
Labels
ACP-acceptedAPI Change Proposal is accepted (seconded with no objections)API Change Proposal is accepted (seconded with no objections)T-libs-apiapi-change-proposalA proposal to add or alter unstable APIs in the standard librariesA proposal to add or alter unstable APIs in the standard libraries
Description
Proposal
Make FromStr on integers const, as well as the parse() method so that "12".parse::<u32>()
is const. (Edit: and the u32::from_str_radix functions, since it's the same implementation.)
Problem statement
There is currently no convenient way to convert a numeric string into a an integer at compile time.
Motivation, use-cases
Reading numeric environment variables at compile time into integer constants.
Solution sketches
Links and related work
rust-lang/rfcs#1907
rust-lang/rust#59133
What happens now?
This issue is part of the libs-api team API change proposal process. Once this issue is filed the libs-api team will review open proposals in its weekly meeting. You should receive feedback within a week or two.
gilescope
Metadata
Metadata
Assignees
Labels
ACP-acceptedAPI Change Proposal is accepted (seconded with no objections)API Change Proposal is accepted (seconded with no objections)T-libs-apiapi-change-proposalA proposal to add or alter unstable APIs in the standard librariesA proposal to add or alter unstable APIs in the standard libraries