2014-10-09 16:19:50 -05:00
|
|
|
// Test that a blank impl for all T:PartialEq conflicts with an impl for some
|
|
|
|
// specific T when T:PartialEq.
|
2014-02-03 19:31:00 -06:00
|
|
|
|
2014-10-09 16:19:50 -05:00
|
|
|
trait OtherTrait {
|
|
|
|
fn noop(&self);
|
|
|
|
}
|
|
|
|
|
|
|
|
trait MyTrait {
|
2015-01-08 05:02:42 -06:00
|
|
|
fn get(&self) -> usize;
|
2014-10-09 16:19:50 -05:00
|
|
|
}
|
|
|
|
|
2015-12-29 23:18:24 -06:00
|
|
|
impl<T:OtherTrait> MyTrait for T {
|
2015-01-08 05:02:42 -06:00
|
|
|
fn get(&self) -> usize { 0 }
|
2014-10-09 16:19:50 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
struct MyType {
|
2015-01-08 05:02:42 -06:00
|
|
|
dummy: usize
|
2014-10-09 16:19:50 -05:00
|
|
|
}
|
2014-02-03 19:31:00 -06:00
|
|
|
|
2018-12-28 17:11:13 -06:00
|
|
|
impl MyTrait for MyType {
|
2019-10-26 10:28:02 -05:00
|
|
|
//~^ ERROR E0119
|
2015-01-08 05:02:42 -06:00
|
|
|
fn get(&self) -> usize { self.dummy }
|
2014-02-03 19:31:00 -06:00
|
|
|
}
|
|
|
|
|
2014-10-09 16:19:50 -05:00
|
|
|
impl OtherTrait for MyType {
|
|
|
|
fn noop(&self) { }
|
2014-02-03 19:31:00 -06:00
|
|
|
}
|
2014-10-09 16:19:50 -05:00
|
|
|
|
|
|
|
fn main() { }
|