]> git.proxmox.com Git - rustc.git/blame - src/test/ui/issues/issue-18446.rs
New upstream version 1.67.1+dfsg1
[rustc.git] / src / test / ui / issues / issue-18446.rs
CommitLineData
8bb4bdeb
XL
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
4trait T {
5 fn foo(&self);
6}
7
dc9dc135 8impl<'a> dyn T + 'a {
8bb4bdeb
XL
9 fn foo(&self) {}
10}
11
12impl T for i32 {
13 fn foo(&self) {}
a7813a04
XL
14}
15
16fn main() {
dc9dc135 17 let x: &dyn T = &0i32;
8bb4bdeb 18 x.foo(); //~ ERROR multiple applicable items in scope [E0034]
54a0048b 19}