2023-10-13 18:31:35 -05:00
|
|
|
trait A {
|
2023-10-15 20:22:25 -05:00
|
|
|
type Type;
|
|
|
|
const CONST: usize;
|
2023-10-13 18:31:35 -05:00
|
|
|
fn foo(&self);
|
|
|
|
}
|
|
|
|
|
|
|
|
trait B {
|
2023-10-15 20:22:25 -05:00
|
|
|
type Type;
|
|
|
|
const CONST: usize;
|
2023-10-13 18:31:35 -05:00
|
|
|
fn foo(&self);
|
|
|
|
}
|
|
|
|
|
|
|
|
#[derive(Debug)]
|
|
|
|
struct S;
|
|
|
|
|
|
|
|
impl<T: std::fmt::Debug> A for T {
|
2023-10-15 20:22:25 -05:00
|
|
|
type Type = ();
|
|
|
|
const CONST: usize = 1; //~ NOTE candidate #1
|
2023-10-13 18:31:35 -05:00
|
|
|
fn foo(&self) {} //~ NOTE candidate #1
|
|
|
|
}
|
|
|
|
|
|
|
|
impl<T: std::fmt::Debug> B for T {
|
2023-10-15 20:22:25 -05:00
|
|
|
type Type = ();
|
|
|
|
const CONST: usize = 2; //~ NOTE candidate #2
|
2023-10-13 18:31:35 -05:00
|
|
|
fn foo(&self) {} //~ NOTE candidate #2
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let s = S;
|
|
|
|
S::foo(&s); //~ ERROR multiple applicable items in scope
|
|
|
|
//~^ NOTE multiple `foo` found
|
2023-10-16 13:25:11 -05:00
|
|
|
//~| HELP use fully-qualified syntax to disambiguate
|
2023-10-15 20:22:25 -05:00
|
|
|
S::CONST; //~ ERROR multiple applicable items in scope
|
|
|
|
//~^ NOTE multiple `CONST` found
|
2023-10-16 13:25:11 -05:00
|
|
|
//~| HELP use fully-qualified syntax to disambiguate
|
2023-10-15 20:22:25 -05:00
|
|
|
let _: S::Type; //~ ERROR ambiguous associated type
|
2023-10-16 13:25:11 -05:00
|
|
|
//~^ HELP use fully-qualified syntax
|
2023-10-13 18:31:35 -05:00
|
|
|
}
|