@rustlang peeps: I want to write a blanket trait impl of From<T> for Type where T implements Trait, and Type also implements Trait, but where T and Type are not the same type. Is there a way in trait bounds to specify effectively "T: !Type" to avoid conflict w/ `From<T> for T`?
-
-
Also, I do not own Trait, only Type.
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
Alternatively, you can implement a `NotType` trait for all types you ever encounter that aren't `Type` and then add a `NotType` constraint to the impl. However, negative trait bounds (these fake ones or real ones) are really questionable in the first place.
-
Ok so the use case is Fail and my own Error type, which implements Fail itself. I want to wrap all Fails with my own Error with an inner context of the wrapped error. What I did instead is create a helper function.
End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.