]> git.proxmox.com Git - rustc.git/blob - src/test/ui/issues/issue-18446.rs
New upstream version 1.49.0+dfsg1
[rustc.git] / src / test / ui / issues / issue-18446.rs
1 // Test that name clashes between the method in an impl for the type
2 // and the method in the trait when both are in the same scope.
3
4 trait T {
5 fn foo(&self);
6 }
7
8 impl<'a> dyn T + 'a {
9 fn foo(&self) {}
10 }
11
12 impl T for i32 {
13 fn foo(&self) {}
14 }
15
16 fn main() {
17 let x: &dyn T = &0i32;
18 x.foo(); //~ ERROR multiple applicable items in scope [E0034]
19 }