mirror of
https://github.com/rust-lang/rust.git
synced 2025-10-03 02:40:40 +00:00
28 lines
434 B
Rust
28 lines
434 B
Rust
trait A {
|
|
fn foo(&self);
|
|
}
|
|
|
|
trait B {
|
|
fn foo(&self);
|
|
}
|
|
|
|
#[derive(Debug)]
|
|
struct S;
|
|
|
|
impl<T: std::fmt::Debug> A for T {
|
|
fn foo(&self) {} //~ NOTE candidate #1
|
|
}
|
|
|
|
impl<T: std::fmt::Debug> B for T {
|
|
fn foo(&self) {} //~ NOTE candidate #2
|
|
}
|
|
|
|
fn main() {
|
|
let s = S;
|
|
S::foo(&s); //~ ERROR multiple applicable items in scope
|
|
//~^ NOTE multiple `foo` found
|
|
//~| HELP disambiguate
|
|
//~| HELP disambiguate
|
|
}
|
|
|