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