1 // Test that you cannot define items with the same name in overlapping inherent 2 // impl blocks. 3 4 #![allow(unused)] 5 6 struct Foo; 7 8 impl Foo { id()9 fn id() {} //~ ERROR duplicate definitions 10 } 11 12 impl Foo { id()13 fn id() {} 14 } 15 16 struct Bar<T>(T); 17 18 impl<T> Bar<T> { bar(&self)19 fn bar(&self) {} //~ ERROR duplicate definitions 20 } 21 22 impl Bar<u32> { bar(&self)23 fn bar(&self) {} 24 } 25 26 struct Baz<T>(T); 27 28 impl<T: Copy> Baz<T> { baz(&self)29 fn baz(&self) {} //~ ERROR duplicate definitions 30 } 31 32 impl<T> Baz<Vec<T>> { baz(&self)33 fn baz(&self) {} 34 } 35 main()36fn main() {} 37