summaryrefslogtreecommitdiffstats
path: root/src/test/ui/rfc-2008-non-exhaustive/variant.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/rfc-2008-non-exhaustive/variant.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/rfc-2008-non-exhaustive/variant.stderr')
-rw-r--r--src/test/ui/rfc-2008-non-exhaustive/variant.stderr92
1 files changed, 92 insertions, 0 deletions
diff --git a/src/test/ui/rfc-2008-non-exhaustive/variant.stderr b/src/test/ui/rfc-2008-non-exhaustive/variant.stderr
new file mode 100644
index 000000000..720b7b119
--- /dev/null
+++ b/src/test/ui/rfc-2008-non-exhaustive/variant.stderr
@@ -0,0 +1,92 @@
+error[E0603]: tuple variant `Tuple` is private
+ --> $DIR/variant.rs:11:48
+ |
+LL | let variant_tuple = NonExhaustiveVariants::Tuple(640);
+ | ^^^^^ private tuple variant
+ |
+note: the tuple variant `Tuple` is defined here
+ --> $DIR/auxiliary/variants.rs:5:23
+ |
+LL | #[non_exhaustive] Tuple(u32),
+ | ^^^^^
+
+error[E0603]: unit variant `Unit` is private
+ --> $DIR/variant.rs:14:47
+ |
+LL | let variant_unit = NonExhaustiveVariants::Unit;
+ | ^^^^ private unit variant
+ |
+note: the unit variant `Unit` is defined here
+ --> $DIR/auxiliary/variants.rs:4:23
+ |
+LL | #[non_exhaustive] Unit,
+ | ^^^^
+
+error[E0603]: unit variant `Unit` is private
+ --> $DIR/variant.rs:18:32
+ |
+LL | NonExhaustiveVariants::Unit => "",
+ | ^^^^ private unit variant
+ |
+note: the unit variant `Unit` is defined here
+ --> $DIR/auxiliary/variants.rs:4:23
+ |
+LL | #[non_exhaustive] Unit,
+ | ^^^^
+
+error[E0603]: tuple variant `Tuple` is private
+ --> $DIR/variant.rs:20:32
+ |
+LL | NonExhaustiveVariants::Tuple(fe_tpl) => "",
+ | ^^^^^ private tuple variant
+ |
+note: the tuple variant `Tuple` is defined here
+ --> $DIR/auxiliary/variants.rs:5:23
+ |
+LL | #[non_exhaustive] Tuple(u32),
+ | ^^^^^
+
+error[E0603]: tuple variant `Tuple` is private
+ --> $DIR/variant.rs:26:35
+ |
+LL | if let NonExhaustiveVariants::Tuple(fe_tpl) = variant_struct {
+ | ^^^^^ private tuple variant
+ |
+note: the tuple variant `Tuple` is defined here
+ --> $DIR/auxiliary/variants.rs:5:23
+ |
+LL | #[non_exhaustive] Tuple(u32),
+ | ^^^^^
+
+error[E0639]: cannot create non-exhaustive variant using struct expression
+ --> $DIR/variant.rs:8:26
+ |
+LL | let variant_struct = NonExhaustiveVariants::Struct { field: 640 };
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error[E0638]: `..` required with variant marked as non-exhaustive
+ --> $DIR/variant.rs:22:9
+ |
+LL | NonExhaustiveVariants::Struct { field } => ""
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+help: add `..` at the end of the field list to ignore all other fields
+ |
+LL | NonExhaustiveVariants::Struct { field , .. } => ""
+ | ~~~~~~
+
+error[E0638]: `..` required with variant marked as non-exhaustive
+ --> $DIR/variant.rs:30:12
+ |
+LL | if let NonExhaustiveVariants::Struct { field } = variant_struct {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+help: add `..` at the end of the field list to ignore all other fields
+ |
+LL | if let NonExhaustiveVariants::Struct { field , .. } = variant_struct {
+ | ~~~~~~
+
+error: aborting due to 8 previous errors
+
+Some errors have detailed explanations: E0603, E0638, E0639.
+For more information about an error, try `rustc --explain E0603`.