]> git.proxmox.com Git - rustc.git/blame - src/test/ui/resolve/issue-73427.rs
Update unsuspicious file list
[rustc.git] / src / test / ui / resolve / issue-73427.rs
CommitLineData
29967ef6
XL
1enum A {
2 StructWithFields { x: () },
3 TupleWithFields(()),
4 Struct {},
5 Tuple(),
6 Unit,
7}
8
9enum B {
10 StructWithFields { x: () },
11 TupleWithFields(()),
12}
13
14enum C {
15 StructWithFields { x: () },
16 TupleWithFields(()),
17 Unit,
18}
19
20enum D {
21 TupleWithFields(()),
22 Unit,
23}
24
f2b60f7d
FG
25enum E {
26 TupleWithFields(()),
27}
28
29967ef6
XL
29fn main() {
30 // Only variants without fields are suggested (and others mentioned in a note) where an enum
31 // is used rather than a variant.
32
33 A.foo();
34 //~^ ERROR expected value, found enum `A`
35 B.foo();
36 //~^ ERROR expected value, found enum `B`
37 C.foo();
38 //~^ ERROR expected value, found enum `C`
39 D.foo();
40 //~^ ERROR expected value, found enum `D`
f2b60f7d
FG
41 E.foo();
42 //~^ ERROR expected value, found enum `E`
29967ef6
XL
43
44 // Only tuple variants are suggested in calls or tuple struct pattern matching.
45
46 let x = A(3);
47 //~^ ERROR expected function, tuple struct or tuple variant, found enum `A`
48 if let A(3) = x { }
49 //~^ ERROR expected tuple struct or tuple variant, found enum `A`
50}