error[E0271]: type mismatch resolving `<Uint<256, 4> as TryFrom<FixedBytes<32>>>::Error == ToUintError<Uint<256, 4>>`
--> src/main.rs:5:34
|
5 | let u = Uint::<256, 4>::from(fb);
| -------------------- ^^ expected `ToUintError<Uint<256, 4>>`, found `Infallible`
| |
| required by a bound introduced by this call
|
= note: expected enum `ToUintError<Uint<256, 4>>`
found enum `Infallible`
= note: required for `Uint<256, 4>` to implement `UintTryFrom<FixedBytes<32>>`
note: required by a bound in `ruint::from::<impl Uint<BITS, LIMBS>>::from`
Component
primitives
What version of Alloy are you on?
v0.6.4
Operating System
macOS (Apple Silicon)
Describe the bug
Despite the implementation of
From<FixedBytes<N> for Uint<N*8>
, it is currently not possible to run the below code:This is due to the line
Uint::<256, 4>::from(fb)
, resolving thefrom
to https://github.com/recmo/uint/blob/main/src/from.rs#L147, which requires the provided type to implementTryFrom
and notFrom
, causing the below error: