You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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>.
The text was updated successfully, but these errors were encountered:
CONTRIBUTING: explain how to use cargo dev ra-setup
Fixesrust-lang#5514
Technically this should be merged after rust-lang/rust-clippy#5655 but it's not very important.
---
changelog: none
The current orphan rules in the coherence check are stricter than they need to be. For example, if I have
then I cannot have an impl like the following
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 alsoOption<Foo>
.The text was updated successfully, but these errors were encountered: