2015-02-21 05:28:28 -06:00
|
|
|
use std::fmt::Debug;
|
2014-10-09 16:19:50 -05:00
|
|
|
use std::default::Default;
|
2014-02-03 19:31:00 -06:00
|
|
|
|
2014-10-09 16:19:50 -05:00
|
|
|
// Test that a blank impl for all T conflicts with an impl for some
|
|
|
|
// specific T.
|
2014-02-03 19:31:00 -06:00
|
|
|
|
2014-10-09 16:19:50 -05:00
|
|
|
trait MyTrait {
|
2015-01-08 05:02:42 -06:00
|
|
|
fn get(&self) -> usize;
|
2014-02-03 19:31:00 -06:00
|
|
|
}
|
|
|
|
|
2015-12-29 23:18:24 -06:00
|
|
|
impl<T> MyTrait for T {
|
2015-01-08 05:02:42 -06:00
|
|
|
fn get(&self) -> usize { 0 }
|
2014-02-03 19:31:00 -06:00
|
|
|
}
|
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
|
|
|
}
|
|
|
|
|
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-10-09 16:19:50 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
fn main() { }
|