You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
playground link with all the impls and functions in example usage
The gist is that I have an impl impl TryFrom<usize> for InvariantType and function signatures with TryInto<InvariantType, Error = MyErrorType>. This enables many ergonomics, but trying to input a plain InvariantType into the function conflicts with the blanket impl TryFrom<T> for T which has a return type ! instead of Error = MyErrorType.
Since ! can and will coerce into anything through a future impl<T> From<!> for T , and there is a current workaround:
it should work, but adding this to the playground link does not change the error message at all.
Also in the playground link, there is a nearly identical error related to a From<NonZeroUsize> for BitWidth and its blanket impls. In that case, I can't even apply the attempted workaround because of orphan rules.
The text was updated successfully, but these errors were encountered:
Adding the From impl does not create a TryFrom impl for an unrelated type. Change typical_function to take a generic error E instead and add where MyError: From<E> to its bounds.
playground link with all the impls and functions in example usage
The gist is that I have an impl
impl TryFrom<usize> for InvariantType
and function signatures withTryInto<InvariantType, Error = MyErrorType>
. This enables many ergonomics, but trying to input a plainInvariantType
into the function conflicts with the blanketimpl TryFrom<T> for T
which has a return type!
instead ofError = MyErrorType
.Since
!
can and will coerce into anything through a futureimpl<T> From<!> for T
, and there is a current workaround:it should work, but adding this to the playground link does not change the error message at all.
Also in the playground link, there is a nearly identical error related to a
From<NonZeroUsize> for BitWidth
and its blanket impls. In that case, I can't even apply the attempted workaround because of orphan rules.The text was updated successfully, but these errors were encountered: