]> git.proxmox.com Git - rustc.git/blame - src/test/ui/coherence/coherence-blanket-conflicts-with-blanket-unimplemented.rs
New upstream version 1.33.0+dfsg1
[rustc.git] / src / test / ui / coherence / coherence-blanket-conflicts-with-blanket-unimplemented.rs
CommitLineData
0731742a
XL
1// revisions: old re
2
3#![cfg_attr(re, feature(re_rebalance_coherence))]
1a4d82fc 4
c34b1796 5use std::fmt::Debug;
1a4d82fc
JJ
6use std::default::Default;
7
8// Test that two blanket impls conflict (at least without negative
9// bounds). After all, some other crate could implement Even or Odd
10// for the same type (though this crate doesn't implement them at all).
11
12trait MyTrait {
13 fn get(&self) -> usize;
14}
15
9346a6ac 16trait Even {}
1a4d82fc 17
9346a6ac 18trait Odd {}
1a4d82fc 19
54a0048b 20impl<T:Even> MyTrait for T {
1a4d82fc
JJ
21 fn get(&self) -> usize { 0 }
22}
23
0731742a
XL
24impl<T:Odd> MyTrait for T {
25//[old]~^ ERROR E0119
26//[re]~^^ ERROR E0119
1a4d82fc
JJ
27 fn get(&self) -> usize { 0 }
28}
29
30fn main() { }