]> git.lizzy.rs Git - rust.git/blob - tests/ui/coherence/coherence-blanket-conflicts-with-specific-trait.rs
Auto merge of #106853 - TimNN:undo-remap, r=oli-obk
[rust.git] / tests / ui / coherence / coherence-blanket-conflicts-with-specific-trait.rs
1 // Test that a blank impl for all T:PartialEq conflicts with an impl for some
2 // specific T when T:PartialEq.
3
4 trait OtherTrait {
5     fn noop(&self);
6 }
7
8 trait MyTrait {
9     fn get(&self) -> usize;
10 }
11
12 impl<T:OtherTrait> MyTrait for T {
13     fn get(&self) -> usize { 0 }
14 }
15
16 struct MyType {
17     dummy: usize
18 }
19
20 impl MyTrait for MyType {
21 //~^ ERROR E0119
22     fn get(&self) -> usize { self.dummy }
23 }
24
25 impl OtherTrait for MyType {
26     fn noop(&self) { }
27 }
28
29 fn main() { }