Skip to content

Commit 4bf281a

Browse files
committedMar 12, 2022
Update non-exhaustive omitted_patterns ui output
1 parent 3344833 commit 4bf281a

File tree

2 files changed

+46
-4
lines changed

2 files changed

+46
-4
lines changed
 

‎src/test/ui/rfc-2008-non-exhaustive/omitted-patterns.stderr

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,34 @@ LL | let NestedStruct { bar: NormalStruct { first_field, .. }, .. } = Nested
4949
= help: ensure that all fields are mentioned explicitly by adding the suggested fields
5050
= note: the pattern is of type `NestedStruct` and the `non_exhaustive_omitted_patterns` attribute was found
5151

52+
warning: some fields are not explicitly listed
53+
--> $DIR/omitted-patterns.rs:173:9
54+
|
55+
LL | let OnlyUnstableStruct { unstable, .. } = OnlyUnstableStruct::new();
56+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ field `unstable2` not listed
57+
|
58+
note: the lint level is defined here
59+
--> $DIR/omitted-patterns.rs:172:12
60+
|
61+
LL | #[warn(non_exhaustive_omitted_patterns)]
62+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
63+
= help: ensure that all fields are mentioned explicitly by adding the suggested fields
64+
= note: the pattern is of type `OnlyUnstableStruct` and the `non_exhaustive_omitted_patterns` attribute was found
65+
66+
warning: some fields are not explicitly listed
67+
--> $DIR/omitted-patterns.rs:181:9
68+
|
69+
LL | let UnstableStruct { stable, stable2, .. } = UnstableStruct::default();
70+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ field `unstable` not listed
71+
|
72+
note: the lint level is defined here
73+
--> $DIR/omitted-patterns.rs:180:12
74+
|
75+
LL | #[warn(non_exhaustive_omitted_patterns)]
76+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
77+
= help: ensure that all fields are mentioned explicitly by adding the suggested fields
78+
= note: the pattern is of type `UnstableStruct` and the `non_exhaustive_omitted_patterns` attribute was found
79+
5280
error: some variants are not matched explicitly
5381
--> $DIR/omitted-patterns.rs:58:9
5482
|
@@ -143,18 +171,18 @@ LL | #[deny(non_exhaustive_omitted_patterns)]
143171
= note: the matched value is of type `UnstableEnum` and the `non_exhaustive_omitted_patterns` attribute was found
144172

145173
error: some variants are not matched explicitly
146-
--> $DIR/omitted-patterns.rs:167:9
174+
--> $DIR/omitted-patterns.rs:168:9
147175
|
148176
LL | _ => {}
149177
| ^ pattern `Unstable2` not covered
150178
|
151179
note: the lint level is defined here
152-
--> $DIR/omitted-patterns.rs:164:12
180+
--> $DIR/omitted-patterns.rs:165:12
153181
|
154182
LL | #[deny(non_exhaustive_omitted_patterns)]
155183
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
156184
= help: ensure that all variants are matched explicitly by adding the suggested match arms
157185
= note: the matched value is of type `OnlyUnstableEnum` and the `non_exhaustive_omitted_patterns` attribute was found
158186

159-
error: aborting due to 8 previous errors; 4 warnings emitted
187+
error: aborting due to 8 previous errors; 6 warnings emitted
160188

‎src/test/ui/rfc-2008-non-exhaustive/stable-omitted-patterns.stderr

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
warning: some fields are not explicitly listed
2+
--> $DIR/stable-omitted-patterns.rs:39:9
3+
|
4+
LL | let UnstableStruct { stable, .. } = UnstableStruct::default();
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ field `stable2` not listed
6+
|
7+
note: the lint level is defined here
8+
--> $DIR/stable-omitted-patterns.rs:38:12
9+
|
10+
LL | #[warn(non_exhaustive_omitted_patterns)]
11+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
12+
= help: ensure that all fields are mentioned explicitly by adding the suggested fields
13+
= note: the pattern is of type `UnstableStruct` and the `non_exhaustive_omitted_patterns` attribute was found
14+
115
error: some variants are not matched explicitly
216
--> $DIR/stable-omitted-patterns.rs:23:9
317
|
@@ -12,5 +26,5 @@ LL | #[deny(non_exhaustive_omitted_patterns)]
1226
= help: ensure that all variants are matched explicitly by adding the suggested match arms
1327
= note: the matched value is of type `UnstableEnum` and the `non_exhaustive_omitted_patterns` attribute was found
1428

15-
error: aborting due to previous error
29+
error: aborting due to previous error; 1 warning emitted
1630

0 commit comments

Comments
 (0)
Please sign in to comment.