]> git.lizzy.rs Git - rust.git/blob - tests/ui/did_you_mean/issue-43871-enum-instead-of-variant.stderr
Rollup merge of #106664 - chenyukang:yukang/fix-106597-remove-lseek, r=cuviper
[rust.git] / tests / ui / did_you_mean / issue-43871-enum-instead-of-variant.stderr
1 error[E0532]: expected tuple struct or tuple variant, found enum `Option`
2   --> $DIR/issue-43871-enum-instead-of-variant.rs:21:12
3    |
4 LL |     if let Option(_) = x {
5    |            ^^^^^^ help: try to match against one of the enum's variants: `std::option::Option::Some`
6    |
7    = help: you might have meant to match against the enum's non-tuple variant
8
9 error[E0532]: expected tuple struct or tuple variant, found enum `Example`
10   --> $DIR/issue-43871-enum-instead-of-variant.rs:27:12
11    |
12 LL |     if let Example(_) = y {
13    |            ^^^^^^^ help: try to match against one of the enum's variants: `Example::Ex`
14    |
15    = help: you might have meant to match against the enum's non-tuple variant
16 note: the enum is defined here
17   --> $DIR/issue-43871-enum-instead-of-variant.rs:1:1
18    |
19 LL | enum Example { Ex(String), NotEx }
20    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
21
22 error[E0423]: expected function, tuple struct or tuple variant, found enum `Option`
23   --> $DIR/issue-43871-enum-instead-of-variant.rs:19:13
24    |
25 LL |     let x = Option(1);
26    |             ^^^^^^ help: try to construct one of the enum's variants: `std::option::Option::Some`
27    |
28    = help: you might have meant to construct the enum's non-tuple variant
29
30 error[E0423]: expected function, tuple struct or tuple variant, found enum `Void`
31   --> $DIR/issue-43871-enum-instead-of-variant.rs:31:13
32    |
33 LL |     let y = Void();
34    |             ^^^^
35    |
36    = help: the enum has no tuple variants to construct
37 note: the enum is defined here
38   --> $DIR/issue-43871-enum-instead-of-variant.rs:3:1
39    |
40 LL | enum Void {}
41    | ^^^^^^^^^^^^
42
43 error[E0423]: expected function, tuple struct or tuple variant, found enum `ManyVariants`
44   --> $DIR/issue-43871-enum-instead-of-variant.rs:33:13
45    |
46 LL |     let z = ManyVariants();
47    |             ^^^^^^^^^^^^
48    |
49    = help: the enum has no tuple variants to construct
50    = help: you might have meant to construct one of the enum's non-tuple variants
51 note: the enum is defined here
52   --> $DIR/issue-43871-enum-instead-of-variant.rs:5:1
53    |
54 LL | / enum ManyVariants {
55 LL | |     One,
56 LL | |     Two,
57 LL | |     Three,
58 ...  |
59 LL | |     Ten,
60 LL | | }
61    | |_^
62
63 error: aborting due to 5 previous errors
64
65 Some errors have detailed explanations: E0423, E0532.
66 For more information about an error, try `rustc --explain E0423`.