summaryrefslogtreecommitdiffstats
path: root/src/test/ui/type-alias-enum-variants/incorrect-variant-form-through-alias-caught.stderr
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/type-alias-enum-variants/incorrect-variant-form-through-alias-caught.stderr')
-rw-r--r--src/test/ui/type-alias-enum-variants/incorrect-variant-form-through-alias-caught.stderr45
1 files changed, 45 insertions, 0 deletions
diff --git a/src/test/ui/type-alias-enum-variants/incorrect-variant-form-through-alias-caught.stderr b/src/test/ui/type-alias-enum-variants/incorrect-variant-form-through-alias-caught.stderr
new file mode 100644
index 000000000..8f3180a86
--- /dev/null
+++ b/src/test/ui/type-alias-enum-variants/incorrect-variant-form-through-alias-caught.stderr
@@ -0,0 +1,45 @@
+error[E0533]: expected unit struct, unit variant or constant, found struct variant `Alias::Braced`
+ --> $DIR/incorrect-variant-form-through-alias-caught.rs:8:5
+ |
+LL | Alias::Braced;
+ | ^^^^^^^^^^^^^
+
+error[E0533]: expected unit struct, unit variant or constant, found struct variant `Alias::Braced`
+ --> $DIR/incorrect-variant-form-through-alias-caught.rs:10:9
+ |
+LL | let Alias::Braced = panic!();
+ | ^^^^^^^^^^^^^
+
+error[E0164]: expected tuple struct or tuple variant, found struct variant `Alias::Braced`
+ --> $DIR/incorrect-variant-form-through-alias-caught.rs:12:9
+ |
+LL | let Alias::Braced(..) = panic!();
+ | ^^^^^^^^^^^^^^^^^ not a tuple variant or struct
+
+error[E0618]: expected function, found enum variant `Alias::Unit`
+ --> $DIR/incorrect-variant-form-through-alias-caught.rs:15:5
+ |
+LL | enum Enum { Braced {}, Unit, Tuple() }
+ | ---- enum variant `Alias::Unit` defined here
+...
+LL | Alias::Unit();
+ | ^^^^^^^^^^^--
+ | |
+ | call expression requires function
+ |
+help: `Alias::Unit` is a unit enum variant, and does not take parentheses to be constructed
+ |
+LL - Alias::Unit();
+LL + Alias::Unit;
+ |
+
+error[E0164]: expected tuple struct or tuple variant, found unit variant `Alias::Unit`
+ --> $DIR/incorrect-variant-form-through-alias-caught.rs:17:9
+ |
+LL | let Alias::Unit() = panic!();
+ | ^^^^^^^^^^^^^ not a tuple variant or struct
+
+error: aborting due to 5 previous errors
+
+Some errors have detailed explanations: E0164, E0533, E0618.
+For more information about an error, try `rustc --explain E0164`.