Why is implementing an external trait using my type as a parameter for an external type legal?
问题 I am modifying some code to depend on rand version 0.5. At first, I was worried how I would enable generating random values of my own types with Standard , but I found out this is legal: impl ::rand::distributions::Distribution<MyType> for ::rand::distributions::Standard { // ... } Why is it legal? I thought implementing an external trait for an external type is illegal. 回答1: The entire purpose of these rules (called the orphan rules or coherence rules ) is to avoid having any conflicting