]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-18446.rs
Rollup merge of #100168 - WaffleLapkin:improve_diagnostics_for_missing_type_in_a_cons...
[rust.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 }