Feature gate: #![feature(const_from)]
This is a tracking issue for const From and Into traits, impls, and related functions.
Public API
const {
let x = 5_u8;
let y: i32 = x.into();
}
Note: there are a hundreds of implementations that could be made const. However, while const traits are unstable, please limit new const implementations to those that are needed for some specific purpose, e.g. supporting a specific feature or experimenting with a certain aspect of . Anything that is going for "completeness" can be done after stabilization.
Steps / History
(Remember to update the S-tracking-* label when checking boxes.)
Unresolved Questions
Feature gate:
#![feature(const_from)]This is a tracking issue for const
FromandIntotraits, impls, and related functions.Public API
Note: there are a hundreds of implementations that could be made
const. However, whileconsttraits are unstable, please limit newconstimplementations to those that are needed for some specific purpose, e.g. supporting a specific feature or experimenting with a certain aspect of . Anything that is going for "completeness" can be done after stabilization.Steps / History
(Remember to update the
S-tracking-*label when checking boxes.)FromandInto#143774Unresolved Questions
Footnotes
https://std-dev-guide.rust-lang.org/feature-lifecycle/stabilization.html ↩