Deriving external traits on external structs

That's incoherent. (Now where'd I put that link... ah!)

Some of the previous discussion here in this thread may have given the wrong impression that incoherence is an issue of API evolution. It isn't; coherence is an issue of type system soundness. (The orphan rules which are the solution to this problem just happen to have been designed with API evolution in mind, hence why the two are often conflated)

Coherence is the property where, given a type and a trait, all code in the compiled binary agrees on the same implementation for that trait. If incoherent impls are allowed to exist in the language, it can lead to what is known in the rust community as the hashtable problem.

4 Likes