]> git.proxmox.com Git - rustc.git/blob - src/test/ui/type-alias-enum-variants/enum-variant-priority-higher-than-other-inherent.rs
New upstream version 1.64.0+dfsg1
[rustc.git] / src / test / ui / type-alias-enum-variants / enum-variant-priority-higher-than-other-inherent.rs
1 // Check that an `enum` variant is resolved, in the value namespace,
2 // with higher priority than other inherent items when there is a conflict.
3
4 enum E {
5 V(u8)
6 }
7
8 impl E {
9 fn V() {}
10 }
11
12 enum E2 {
13 V,
14 }
15
16 impl E2 {
17 const V: u8 = 0;
18 }
19
20 fn main() {
21 <E>::V(); //~ ERROR this enum variant takes 1 argument but 0 arguments were supplied
22 let _: u8 = <E2>::V; //~ ERROR mismatched types
23 }