Why does U256::try_from(0u128) does not implement TryFrom<u128, Error=Infallible>? #523
-
As the question states, I'm curious as to why it is the case that |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
This is blocked by specialization. Because rust does not yet support specialization of trait impls, we have to implement generically, which means the error type must be the same for all values of You can read about some related rough edges in the It would be also great to do things like the following, but unfortunately also blocked by language features
|
Beta Was this translation helpful? Give feedback.
This is blocked by specialization. Because rust does not yet support specialization of trait impls, we have to implement generically, which means the error type must be the same for all values of
BITS
andLIMBS
. So even in the case where we can guarantee anInfallible
conversion, the error unfortunately type cannot beInfallible
You can read about some related rough edges in the
TryFrom
impls hereIt would be also great to do things like the following, but unfortunately also blocked by language features