3 ms·
I don’t know the specifics of this function yet but don’t forget there are lots of things that could be done in const fn that aren’t accepted yet; it’s often th
by steveklabnik 6y ago
I don’t know the specifics of this function yet but don’t forget there are lots of things that could be done in const fn that aren’t accepted yet; it’s often the reason things work out like this for these functions.
EDIT: okay, I looked into it! (rust-analyzer is really useful for this...)
this function calls TryFrom::try_from. which runs afoul of https://github.com/rust-lang/rfcs/blob/master/text/0911-const-fn.md#detailed-design https://github.com/rust-lang/rfcs/blob/master/text/0911-cons...
> Traits, trait implementations and their methods cannot be const - this allows us to properly design a constness/CTFE system that interacts well with traits - for more details, see Alternatives.
So, there you go.