- 
                Notifications
    You must be signed in to change notification settings 
- Fork 13.9k
Closed
Labels
B-RFC-approvedBlocker: Approved by a merged RFC but not yet implemented.Blocker: Approved by a merged RFC but not yet implemented.
Milestone
Description
The current coherence rules are too smart. I think we should consider adding some limits to rein it in. In particular, imagine that crate A defines:
pub struct Foo { .. }And crate B then defines:
extern crate A;
trait MyTrait { }
impl<T:Clone> MyTrait for T { }
impl MyTrait for A::Foo { }This is currently accepted today, I believe. However, I think it should not be, because it means that now crate A cannot add an impl of Clone for Foo for fear of breaking crate B.
My proposed fix is to modify the coherence check so that you can't assume that a type from another crate won't implement a trait from another crate.
cc @aturon
Metadata
Metadata
Assignees
Labels
B-RFC-approvedBlocker: Approved by a merged RFC but not yet implemented.Blocker: Approved by a merged RFC but not yet implemented.