summaryrefslogtreecommitdiffstats
path: root/tests/ui/rfcs/rfc-2008-non-exhaustive/omitted-patterns.stderr
blob: 1037033c4b74bef84fbdb32f9de0d694e8f0755e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
error: some fields are not explicitly listed
  --> $DIR/omitted-patterns.rs:139:9
   |
LL |         VariantNonExhaustive::Bar { x, .. } => {}
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ field `y` not listed
   |
   = help: ensure that all fields are mentioned explicitly by adding the suggested fields
   = note: the pattern is of type `VariantNonExhaustive` and the `non_exhaustive_omitted_patterns` attribute was found
note: the lint level is defined here
  --> $DIR/omitted-patterns.rs:45:8
   |
LL | #[deny(non_exhaustive_omitted_patterns)]
   |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: some fields are not explicitly listed
  --> $DIR/omitted-patterns.rs:143:9
   |
LL |     let FunctionalRecord { first_field, second_field, .. } = FunctionalRecord::default();
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ field `third_field` not listed
   |
   = help: ensure that all fields are mentioned explicitly by adding the suggested fields
   = note: the pattern is of type `FunctionalRecord` and the `non_exhaustive_omitted_patterns` attribute was found

error: some fields are not explicitly listed
  --> $DIR/omitted-patterns.rs:149:29
   |
LL |     let NestedStruct { bar: NormalStruct { first_field, .. }, .. } = NestedStruct::default();
   |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ field `second_field` not listed
   |
   = help: ensure that all fields are mentioned explicitly by adding the suggested fields
   = note: the pattern is of type `NormalStruct` and the `non_exhaustive_omitted_patterns` attribute was found

error: some fields are not explicitly listed
  --> $DIR/omitted-patterns.rs:149:9
   |
LL |     let NestedStruct { bar: NormalStruct { first_field, .. }, .. } = NestedStruct::default();
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ field `foo` not listed
   |
   = help: ensure that all fields are mentioned explicitly by adding the suggested fields
   = note: the pattern is of type `NestedStruct` and the `non_exhaustive_omitted_patterns` attribute was found

error: some fields are not explicitly listed
  --> $DIR/omitted-patterns.rs:212:9
   |
LL |     let OnlyUnstableStruct { unstable, .. } = OnlyUnstableStruct::new();
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ field `unstable2` not listed
   |
   = help: ensure that all fields are mentioned explicitly by adding the suggested fields
   = note: the pattern is of type `OnlyUnstableStruct` and the `non_exhaustive_omitted_patterns` attribute was found

error: some fields are not explicitly listed
  --> $DIR/omitted-patterns.rs:218:9
   |
LL |     let UnstableStruct { stable, stable2, .. } = UnstableStruct::default();
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ field `unstable` not listed
   |
   = help: ensure that all fields are mentioned explicitly by adding the suggested fields
   = note: the pattern is of type `UnstableStruct` and the `non_exhaustive_omitted_patterns` attribute was found

error: some variants are not matched explicitly
  --> $DIR/omitted-patterns.rs:65:11
   |
LL |     match non_enum {
   |           ^^^^^^^^ pattern `NonExhaustiveEnum::Struct { .. }` not covered
   |
   = help: ensure that all variants are matched explicitly by adding the suggested match arms
   = note: the matched value is of type `NonExhaustiveEnum` and the `non_exhaustive_omitted_patterns` attribute was found

error: some variants are not matched explicitly
  --> $DIR/omitted-patterns.rs:72:11
   |
LL |     match non_enum {
   |           ^^^^^^^^ pattern `NonExhaustiveEnum::Tuple(_)` not covered
   |
   = help: ensure that all variants are matched explicitly by adding the suggested match arms
   = note: the matched value is of type `NonExhaustiveEnum` and the `non_exhaustive_omitted_patterns` attribute was found

error: some variants are not matched explicitly
  --> $DIR/omitted-patterns.rs:93:11
   |
LL |     match (non_enum, true) {
   |           ^^^^^^^^^^^^^^^^ pattern `(NonExhaustiveEnum::Struct { .. }, _)` not covered
   |
   = help: ensure that all variants are matched explicitly by adding the suggested match arms
   = note: the matched value is of type `(NonExhaustiveEnum, bool)` and the `non_exhaustive_omitted_patterns` attribute was found

error: some variants are not matched explicitly
  --> $DIR/omitted-patterns.rs:106:11
   |
LL |     match (true, non_enum) {
   |           ^^^^^^^^^^^^^^^^ pattern `(_, NonExhaustiveEnum::Struct { .. })` not covered
   |
   = help: ensure that all variants are matched explicitly by adding the suggested match arms
   = note: the matched value is of type `(bool, NonExhaustiveEnum)` and the `non_exhaustive_omitted_patterns` attribute was found

error: some variants are not matched explicitly
  --> $DIR/omitted-patterns.rs:113:11
   |
LL |     match Some(non_enum) {
   |           ^^^^^^^^^^^^^^ pattern `Some(NonExhaustiveEnum::Struct { .. })` not covered
   |
   = help: ensure that all variants are matched explicitly by adding the suggested match arms
   = note: the matched value is of type `Option<NonExhaustiveEnum>` and the `non_exhaustive_omitted_patterns` attribute was found

error: some variants are not matched explicitly
  --> $DIR/omitted-patterns.rs:129:11
   |
LL |     match NestedNonExhaustive::B {
   |           ^^^^^^^^^^^^^^^^^^^^^^ patterns `NestedNonExhaustive::C`, `NestedNonExhaustive::A(NonExhaustiveEnum::Tuple(_))` and `NestedNonExhaustive::A(NonExhaustiveEnum::Struct { .. })` not covered
   |
   = help: ensure that all variants are matched explicitly by adding the suggested match arms
   = note: the matched value is of type `NestedNonExhaustive` and the `non_exhaustive_omitted_patterns` attribute was found

error: some variants are not matched explicitly
  --> $DIR/omitted-patterns.rs:184:11
   |
LL |     match UnstableEnum::Stable {
   |           ^^^^^^^^^^^^^^^^^^^^ pattern `UnstableEnum::Unstable` not covered
   |
   = help: ensure that all variants are matched explicitly by adding the suggested match arms
   = note: the matched value is of type `UnstableEnum` and the `non_exhaustive_omitted_patterns` attribute was found

error: some variants are not matched explicitly
  --> $DIR/omitted-patterns.rs:206:11
   |
LL |     match OnlyUnstableEnum::Unstable {
   |           ^^^^^^^^^^^^^^^^^^^^^^^^^^ pattern `OnlyUnstableEnum::Unstable2` not covered
   |
   = help: ensure that all variants are matched explicitly by adding the suggested match arms
   = note: the matched value is of type `OnlyUnstableEnum` and the `non_exhaustive_omitted_patterns` attribute was found

error[E0005]: refutable pattern in local binding
  --> $DIR/omitted-patterns.rs:228:9
   |
LL |     let local_refutable @ NonExhaustiveEnum::Unit = NonExhaustiveEnum::Unit;
   |         ^^^^^^^^^^^^^^^ pattern `_` not covered
   |
   = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant
   = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html
   = note: the matched value is of type `NonExhaustiveEnum`
help: you might want to use `let else` to handle the variant that isn't matched
   |
LL |     let local_refutable @ NonExhaustiveEnum::Unit = NonExhaustiveEnum::Unit else { todo!() };
   |                                                                             ++++++++++++++++

error: some variants are not matched explicitly
  --> $DIR/omitted-patterns.rs:232:11
   |
LL |     match &non_enum {
   |           ^^^^^^^^^ pattern `&NonExhaustiveEnum::Struct { .. }` not covered
   |
   = help: ensure that all variants are matched explicitly by adding the suggested match arms
   = note: the matched value is of type `&NonExhaustiveEnum` and the `non_exhaustive_omitted_patterns` attribute was found

error: some variants are not matched explicitly
  --> $DIR/omitted-patterns.rs:240:11
   |
LL |     match (true, &non_enum) {
   |           ^^^^^^^^^^^^^^^^^ patterns `(_, &NonExhaustiveEnum::Tuple(_))` and `(_, &NonExhaustiveEnum::Struct { .. })` not covered
   |
   = help: ensure that all variants are matched explicitly by adding the suggested match arms
   = note: the matched value is of type `(bool, &NonExhaustiveEnum)` and the `non_exhaustive_omitted_patterns` attribute was found

error: some variants are not matched explicitly
  --> $DIR/omitted-patterns.rs:247:11
   |
LL |     match (&non_enum, true) {
   |           ^^^^^^^^^^^^^^^^^ patterns `(&NonExhaustiveEnum::Tuple(_), _)` and `(&NonExhaustiveEnum::Struct { .. }, _)` not covered
   |
   = help: ensure that all variants are matched explicitly by adding the suggested match arms
   = note: the matched value is of type `(&NonExhaustiveEnum, bool)` and the `non_exhaustive_omitted_patterns` attribute was found

error: some variants are not matched explicitly
  --> $DIR/omitted-patterns.rs:254:11
   |
LL |     match Some(&non_enum) {
   |           ^^^^^^^^^^^^^^^ pattern `Some(&NonExhaustiveEnum::Struct { .. })` not covered
   |
   = help: ensure that all variants are matched explicitly by adding the suggested match arms
   = note: the matched value is of type `Option<&NonExhaustiveEnum>` and the `non_exhaustive_omitted_patterns` attribute was found

error: aborting due to 19 previous errors

For more information about this error, try `rustc --explain E0005`.