]> git.lizzy.rs Git - rust.git/blob - src/test/ui/rfc-2008-non-exhaustive/variant.stderr
Rollup merge of #94689 - compiler-errors:on-unimplemented-substs, r=petrochenkov
[rust.git] / src / test / ui / rfc-2008-non-exhaustive / variant.stderr
1 error[E0603]: tuple variant `Tuple` is private
2   --> $DIR/variant.rs:11:48
3    |
4 LL |     let variant_tuple = NonExhaustiveVariants::Tuple(640);
5    |                                                ^^^^^ private tuple variant
6    |
7 note: the tuple variant `Tuple` is defined here
8   --> $DIR/auxiliary/variants.rs:5:23
9    |
10 LL |     #[non_exhaustive] Tuple(u32),
11    |                       ^^^^^^^^^^
12
13 error[E0603]: unit variant `Unit` is private
14   --> $DIR/variant.rs:14:47
15    |
16 LL |     let variant_unit = NonExhaustiveVariants::Unit;
17    |                                               ^^^^ private unit variant
18    |
19 note: the unit variant `Unit` is defined here
20   --> $DIR/auxiliary/variants.rs:4:23
21    |
22 LL |     #[non_exhaustive] Unit,
23    |                       ^^^^
24
25 error[E0603]: unit variant `Unit` is private
26   --> $DIR/variant.rs:18:32
27    |
28 LL |         NonExhaustiveVariants::Unit => "",
29    |                                ^^^^ private unit variant
30    |
31 note: the unit variant `Unit` is defined here
32   --> $DIR/auxiliary/variants.rs:4:23
33    |
34 LL |     #[non_exhaustive] Unit,
35    |                       ^^^^
36
37 error[E0603]: tuple variant `Tuple` is private
38   --> $DIR/variant.rs:20:32
39    |
40 LL |         NonExhaustiveVariants::Tuple(fe_tpl) => "",
41    |                                ^^^^^ private tuple variant
42    |
43 note: the tuple variant `Tuple` is defined here
44   --> $DIR/auxiliary/variants.rs:5:23
45    |
46 LL |     #[non_exhaustive] Tuple(u32),
47    |                       ^^^^^^^^^^
48
49 error[E0603]: tuple variant `Tuple` is private
50   --> $DIR/variant.rs:26:35
51    |
52 LL |     if let NonExhaustiveVariants::Tuple(fe_tpl) = variant_struct {
53    |                                   ^^^^^ private tuple variant
54    |
55 note: the tuple variant `Tuple` is defined here
56   --> $DIR/auxiliary/variants.rs:5:23
57    |
58 LL |     #[non_exhaustive] Tuple(u32),
59    |                       ^^^^^^^^^^
60
61 error[E0639]: cannot create non-exhaustive variant using struct expression
62   --> $DIR/variant.rs:8:26
63    |
64 LL |     let variant_struct = NonExhaustiveVariants::Struct { field: 640 };
65    |                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
66
67 error[E0638]: `..` required with variant marked as non-exhaustive
68   --> $DIR/variant.rs:22:9
69    |
70 LL |         NonExhaustiveVariants::Struct { field } => ""
71    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
72    |
73 help: add `..` at the end of the field list to ignore all other fields
74    |
75 LL |         NonExhaustiveVariants::Struct { field , .. } => ""
76    |                                               ~~~~~~
77
78 error[E0638]: `..` required with variant marked as non-exhaustive
79   --> $DIR/variant.rs:30:12
80    |
81 LL |     if let NonExhaustiveVariants::Struct { field } = variant_struct {
82    |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
83    |
84 help: add `..` at the end of the field list to ignore all other fields
85    |
86 LL |     if let NonExhaustiveVariants::Struct { field , .. } = variant_struct {
87    |                                                  ~~~~~~
88
89 error: aborting due to 8 previous errors
90
91 Some errors have detailed explanations: E0603, E0638, E0639.
92 For more information about an error, try `rustc --explain E0603`.