rust/tests/ui/rfc-2008-non-exhaustive/variant.stderr
2023-04-06 16:52:17 +00:00

103 lines
3.5 KiB
Plaintext

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),
| ----------------- ^^^^^
| |
| cannot be constructed because it is `#[non_exhaustive]`
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,
| ----------------- ^^^^
| |
| cannot be constructed because it is `#[non_exhaustive]`
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,
| ----------------- ^^^^
| |
| cannot be constructed because it is `#[non_exhaustive]`
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),
| ----------------- ^^^^^
| |
| cannot be constructed because it is `#[non_exhaustive]`
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),
| ----------------- ^^^^^
| |
| cannot be constructed because it is `#[non_exhaustive]`
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`.