error-chain
error-chain copied to clipboard
Implementing foreign links on generic errors
Hi.
Is there any way to accomplish this?
For something like std::sync::PoisonError<T> for example.
No, there is no polymorphism. You can foreign link PoinsonError<Thing> though for example.
Thank you, yes, that much I succeed to do. The problem arises when there is a generic error, especially with lifetime parameters.
I think it could be implemented with addiitional parametric macro implementation - but I worked around it, so I wouldn't be able to give it a try. On Mon, 24 Apr 2017 at 7:09 Yamakaky [email protected] wrote:
No, there is no polymorphism. You can foreign link PoinsonError<Thing> though for example.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/brson/error-chain/issues/146#issuecomment-296520596, or mute the thread https://github.com/notifications/unsubscribe-auth/AAeZwBlSOUp5WyOV5Ybz5gdxC5QPmmH9ks5rzCB0gaJpZM4NFqWi .
Is there a plan to implement this? It has come up a few times for me.
Yeah, I know... If you have an idea of implementation, it's more than welcome ^^
There is parse_generics_shim, which is macro from closed RFC, that allows parsing generics and where clause in macro, it's limited, but possible solution.