rust/tests/ui/type-alias-enum-variants/incorrect-variant-form-thro...

46 lines
1.6 KiB
Plaintext

error[E0533]: expected value, found struct variant `Alias::Braced`
--> $DIR/incorrect-variant-form-through-alias-caught.rs:8:5
|
LL | Alias::Braced;
| ^^^^^^^^^^^^^ not a value
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!();
| ^^^^^^^^^^^^^ not a unit struct, unit variant or constant
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 struct or tuple variant
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 struct or tuple variant
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`.