2015-02-21 05:28:28 -06:00
|
|
|
use std::fmt::Debug;
|
2014-10-17 08:13:22 -05:00
|
|
|
use std::default::Default;
|
|
|
|
|
|
|
|
// Test that two blanket impls conflict (at least without negative
|
|
|
|
// bounds). After all, some other crate could implement Even or Odd
|
|
|
|
// for the same type (though this crate doesn't implement them at all).
|
|
|
|
|
|
|
|
trait MyTrait {
|
2015-01-08 05:02:42 -06:00
|
|
|
fn get(&self) -> usize;
|
2014-10-17 08:13:22 -05:00
|
|
|
}
|
|
|
|
|
2015-04-18 00:12:20 -05:00
|
|
|
trait Even {}
|
2014-10-17 08:13:22 -05:00
|
|
|
|
2015-04-18 00:12:20 -05:00
|
|
|
trait Odd {}
|
2014-10-17 08:13:22 -05:00
|
|
|
|
2015-12-29 23:18:24 -06:00
|
|
|
impl<T:Even> MyTrait for T {
|
2015-01-08 05:02:42 -06:00
|
|
|
fn get(&self) -> usize { 0 }
|
2014-10-17 08:13:22 -05:00
|
|
|
}
|
|
|
|
|
2018-12-28 17:11:13 -06:00
|
|
|
impl<T:Odd> MyTrait for T {
|
2019-10-26 10:28:02 -05:00
|
|
|
//~^ ERROR E0119
|
2015-01-08 05:02:42 -06:00
|
|
|
fn get(&self) -> usize { 0 }
|
2014-10-17 08:13:22 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
fn main() { }
|