]> git.lizzy.rs Git - rust.git/blob - src/test/ui/coherence/coherence-blanket-conflicts-with-blanket-unimplemented.rs
Merge commit 'f51aade56f93175dde89177a92e3669ebd8e7592' into clippyup
[rust.git] / src / test / ui / coherence / coherence-blanket-conflicts-with-blanket-unimplemented.rs
1 use std::fmt::Debug;
2 use std::default::Default;
3
4 // Test that two blanket impls conflict (at least without negative
5 // bounds).  After all, some other crate could implement Even or Odd
6 // for the same type (though this crate doesn't implement them at all).
7
8 trait MyTrait {
9     fn get(&self) -> usize;
10 }
11
12 trait Even {}
13
14 trait Odd {}
15
16 impl<T:Even> MyTrait for T {
17     fn get(&self) -> usize { 0 }
18 }
19
20 impl<T:Odd> MyTrait for T {
21 //~^ ERROR E0119
22     fn get(&self) -> usize { 0 }
23 }
24
25 fn main() { }