granite-rust/tests/ui/type-alias-enum-variants
Esteban Küber ec7a188f16 More accurate suggestions when writing wrong style of enum variant literal
```
error[E0533]: expected value, found struct variant `E::Empty3`
  --> $DIR/empty-struct-braces-expr.rs:18:14
   |
LL |     let e3 = E::Empty3;
   |              ^^^^^^^^^ not a value
   |
help: you might have meant to create a new value of the struct
   |
LL |     let e3 = E::Empty3 {};
   |                        ++
```
```
error[E0533]: expected value, found struct variant `E::V`
  --> $DIR/struct-literal-variant-in-if.rs:10:13
   |
LL |     if x == E::V { field } {}
   |             ^^^^ not a value
   |
help: you might have meant to create a new value of the struct
   |
LL |     if x == (E::V { field }) {}
   |             +              +
```
```
error[E0618]: expected function, found enum variant `Enum::Unit`
  --> $DIR/suggestion-highlights.rs:15:5
   |
LL |     Unit,
   |     ---- enum variant `Enum::Unit` defined here
...
LL |     Enum::Unit();
   |     ^^^^^^^^^^--
   |     |
   |     call expression requires function
   |
help: `Enum::Unit` is a unit enum variant, and does not take parentheses to be constructed
   |
LL -     Enum::Unit();
LL +     Enum::Unit;
   |
```
```
error[E0599]: no variant or associated item named `tuple` found for enum `Enum` in the current scope
  --> $DIR/suggestion-highlights.rs:36:11
   |
LL | enum Enum {
   | --------- variant or associated item `tuple` not found for this enum
...
LL |     Enum::tuple;
   |           ^^^^^ variant or associated item not found in `Enum`
   |
help: there is a variant with a similar name
   |
LL |     Enum::Tuple(/* i32 */);
   |           ~~~~~~~~~~~~~~~~;
   |
```
2024-07-18 18:20:35 +00:00
..
enum-variant-generic-args-pass.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
enum-variant-generic-args.rs diagnostics: remove inconsistent English article "this" from E0107 2023-02-23 10:27:06 -07:00
enum-variant-generic-args.stderr Tweak wording of type errors involving type params 2023-10-18 23:53:18 +00:00
enum-variant-priority-higher-than-other-inherent.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
enum-variant-priority-higher-than-other-inherent.stderr Use ordinal number in argument error 2024-07-14 13:50:09 +09:00
enum-variant-priority-lint-ambiguous_associated_items.rs Stop using hir_ty_to_ty in rustc_privacy 2024-02-07 14:59:26 +00:00
enum-variant-priority-lint-ambiguous_associated_items.stderr Stop using hir_ty_to_ty in rustc_privacy 2024-02-07 14:59:26 +00:00
incorrect-variant-form-through-alias-caught.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
incorrect-variant-form-through-alias-caught.stderr More accurate suggestions when writing wrong style of enum variant literal 2024-07-18 18:20:35 +00:00
incorrect-variant-form-through-Self-issue-58006.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
incorrect-variant-form-through-Self-issue-58006.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
issue-57866.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-61801-path-pattern-can-infer.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-63151-dead-code-lint-fields-in-patterns.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
no-type-application-on-aliased-enum-variant.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
no-type-application-on-aliased-enum-variant.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
resolve-to-enum-variant-in-type-namespace-and-error.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
resolve-to-enum-variant-in-type-namespace-and-error.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
self-in-enum-definition.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
self-in-enum-definition.stderr Update documentation 2024-03-20 09:49:57 +00:00
type-alias-enum-variants-pass.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00