mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 07:14:28 +00:00
23 lines
318 B
Rust
23 lines
318 B
Rust
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);
|
|
//~^ error: method named `foo` found for struct `Bar` in the current scope
|
|
}
|