Closed
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.