rust/tests/ui/empty
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
..
auxiliary
empty-attributes.rs RFC 2383: Stabilize lint_reasons 🎉 2024-06-25 17:22:22 +02:00
empty-attributes.stderr RFC 2383: Stabilize lint_reasons 🎉 2024-06-25 17:22:22 +02:00
empty-comment.rs
empty-comment.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
empty-linkname.rs
empty-linkname.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
empty-macro-use.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
empty-macro-use.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
empty-never-array.rs Migrate pattern matching 2023-01-11 14:40:02 -08:00
empty-never-array.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
empty-struct-braces-expr.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
empty-struct-braces-expr.stderr More accurate suggestions when writing wrong style of enum variant literal 2024-07-18 18:20:35 +00:00
empty-struct-braces-pat-1.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
empty-struct-braces-pat-1.stderr
empty-struct-braces-pat-2.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
empty-struct-braces-pat-2.stderr
empty-struct-braces-pat-3.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
empty-struct-braces-pat-3.stderr
empty-struct-tuple-pat.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
empty-struct-tuple-pat.stderr resolve: Remove struct_field_names_untracked 2023-03-13 17:31:55 +04:00
empty-struct-unit-expr.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
empty-struct-unit-expr.stderr
empty-struct-unit-pat.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
empty-struct-unit-pat.stderr
issue-37026.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-37026.stderr Modify primary span label for E0308 2023-01-30 20:12:19 +00:00
no-link.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00