2017-03-06 09:19:48 -06:00
|
|
|
// Test that name clashes between the method in an impl for the type
|
|
|
|
// and the method in the trait when both are in the same scope.
|
|
|
|
|
|
|
|
trait T {
|
|
|
|
fn foo(&self);
|
|
|
|
}
|
|
|
|
|
2019-05-28 13:46:13 -05:00
|
|
|
impl<'a> dyn T + 'a {
|
2017-03-06 09:19:48 -06:00
|
|
|
fn foo(&self) {}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl T for i32 {
|
|
|
|
fn foo(&self) {}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
2019-05-28 13:46:13 -05:00
|
|
|
let x: &dyn T = &0i32;
|
2017-03-06 09:19:48 -06:00
|
|
|
x.foo(); //~ ERROR multiple applicable items in scope [E0034]
|
|
|
|
}
|