2015-11-20 04:11:08 -06:00
|
|
|
trait Foo<A> {
|
|
|
|
fn foo(&self, a: A) -> A {
|
|
|
|
a
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
trait NotRelevant<A> {
|
|
|
|
fn nr(&self, a: A) -> A {
|
|
|
|
a
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
struct Bar;
|
|
|
|
|
|
|
|
impl NotRelevant<usize> for Bar {}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let f1 = Bar;
|
|
|
|
|
|
|
|
f1.foo(1usize);
|
2015-11-28 04:42:25 -06:00
|
|
|
//~^ error: method named `foo` found for type `Bar` in the current scope
|
2015-11-20 04:11:08 -06:00
|
|
|
}
|