Closed
Description
The current orphan rules in the coherence check are stricter than they need to be. For example, if I have
struct Foo
then I cannot have an impl like the following
impl ToStr for @Foo
The goal of the orphan rules is to guarantee that we can detect duplicate trait implementations so as to enforce coherence. To this end, it is only necessary to ensure that we could find any potentially conflicting impl. If we enforce the rule that the "for" type must "involve" some nominal type from the current crate, that is adequate for this purpose. For example @Foo
should be ok but also Option<Foo>
.