summaryrefslogtreecommitdiffstats
path: root/src/test/ui/pattern/usefulness/doc-hidden-fields.stderr
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:02:58 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:02:58 +0000
commit698f8c2f01ea549d77d7dc3338a12e04c11057b9 (patch)
tree173a775858bd501c378080a10dca74132f05bc50 /src/test/ui/pattern/usefulness/doc-hidden-fields.stderr
parentInitial commit. (diff)
downloadrustc-698f8c2f01ea549d77d7dc3338a12e04c11057b9.tar.xz
rustc-698f8c2f01ea549d77d7dc3338a12e04c11057b9.zip
Adding upstream version 1.64.0+dfsg1.upstream/1.64.0+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/test/ui/pattern/usefulness/doc-hidden-fields.stderr')
-rw-r--r--src/test/ui/pattern/usefulness/doc-hidden-fields.stderr59
1 files changed, 59 insertions, 0 deletions
diff --git a/src/test/ui/pattern/usefulness/doc-hidden-fields.stderr b/src/test/ui/pattern/usefulness/doc-hidden-fields.stderr
new file mode 100644
index 000000000..f277bfbc8
--- /dev/null
+++ b/src/test/ui/pattern/usefulness/doc-hidden-fields.stderr
@@ -0,0 +1,59 @@
+error: pattern requires `..` due to inaccessible fields
+ --> $DIR/doc-hidden-fields.rs:15:9
+ |
+LL | let HiddenStruct { one, two } = HiddenStruct::default();
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+help: ignore the inaccessible and unused fields
+ |
+LL | let HiddenStruct { one, two, .. } = HiddenStruct::default();
+ | ++++
+
+error[E0027]: pattern does not mention field `two` and inaccessible fields
+ --> $DIR/doc-hidden-fields.rs:18:9
+ |
+LL | let HiddenStruct { one } = HiddenStruct::default();
+ | ^^^^^^^^^^^^^^^^^^^^ missing field `two` and inaccessible fields
+ |
+help: include the missing field in the pattern and ignore the inaccessible fields
+ |
+LL | let HiddenStruct { one, two, .. } = HiddenStruct::default();
+ | ~~~~~~~~~~~
+help: if you don't care about this missing field, you can explicitly ignore it
+ |
+LL | let HiddenStruct { one, .. } = HiddenStruct::default();
+ | ~~~~~~
+
+error[E0027]: pattern does not mention field `two`
+ --> $DIR/doc-hidden-fields.rs:21:9
+ |
+LL | let HiddenStruct { one, hide } = HiddenStruct::default();
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^ missing field `two`
+ |
+help: include the missing field in the pattern
+ |
+LL | let HiddenStruct { one, hide, two } = HiddenStruct::default();
+ | ~~~~~~~
+help: if you don't care about this missing field, you can explicitly ignore it
+ |
+LL | let HiddenStruct { one, hide, .. } = HiddenStruct::default();
+ | ~~~~~~
+
+error[E0027]: pattern does not mention field `im_hidden`
+ --> $DIR/doc-hidden-fields.rs:24:9
+ |
+LL | let InCrate { a, b } = InCrate { a: 0, b: false, im_hidden: 0 };
+ | ^^^^^^^^^^^^^^^^ missing field `im_hidden`
+ |
+help: include the missing field in the pattern
+ |
+LL | let InCrate { a, b, im_hidden } = InCrate { a: 0, b: false, im_hidden: 0 };
+ | ~~~~~~~~~~~~~
+help: if you don't care about this missing field, you can explicitly ignore it
+ |
+LL | let InCrate { a, b, .. } = InCrate { a: 0, b: false, im_hidden: 0 };
+ | ~~~~~~
+
+error: aborting due to 4 previous errors
+
+For more information about this error, try `rustc --explain E0027`.