]> git.proxmox.com Git - rustc.git/blob - tests/ui/codemap_tests/overlapping_inherent_impls.rs
New upstream version 1.68.2+dfsg1
[rustc.git] / tests / ui / codemap_tests / overlapping_inherent_impls.rs
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 {
9 fn id() {} //~ ERROR duplicate definitions
10 }
11
12 impl Foo {
13 fn id() {}
14 }
15
16 struct Bar<T>(T);
17
18 impl<T> Bar<T> {
19 fn bar(&self) {} //~ ERROR duplicate definitions
20 }
21
22 impl Bar<u32> {
23 fn bar(&self) {}
24 }
25
26 struct Baz<T>(T);
27
28 impl<T: Copy> Baz<T> {
29 fn baz(&self) {} //~ ERROR duplicate definitions
30 }
31
32 impl<T> Baz<Vec<T>> {
33 fn baz(&self) {}
34 }
35
36 fn main() {}