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
When I have an anyhow::Error and convert that into a Box<dyn std::error::Error>, it seems that I can no longer downcast it back into anything (neither anyhow::Error nor the original error type). This differs from the behavior of casting the anyhow error to a &(dyn StdError + 'static), which does still allow downcasting to the orignal type.
Perhaps this is a limitation that cannot be solved, but I couldn't find it documented so I wasn't sure if it was known.
Naively, I thought the from_boxed1 could check to see if the Boxed error is an ErrorImpl, but it can't since object_boxed revives the erased type before boxing2
When I have an
anyhow::Error
and convert that into aBox<dyn std::error::Error>
, it seems that I can no longer downcast it back into anything (neitheranyhow::Error
nor the original error type). This differs from the behavior of casting the anyhow error to a&(dyn StdError + 'static)
, which does still allow downcasting to the orignal type.Perhaps this is a limitation that cannot be solved, but I couldn't find it documented so I wasn't sure if it was known.
The text was updated successfully, but these errors were encountered: