rust/tests/ui/expr
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
..
compound-assignment [AUTO-GENERATED] Migrate ui tests from `//` to `//@` directives 2024-02-16 20:02:50 +00:00
if Make parse error suggestions verbose and fix spans 2024-07-12 03:02:57 +00:00
malformed_closure Use parenthetical notation for `Fn` traits 2024-05-29 22:26:54 +00:00
block-fn.rs Move 100 entries from tests/ui into subdirs 2024-05-20 19:55:59 -07:00
block-generic.rs Move 100 entries from tests/ui into subdirs 2024-05-20 19:55:59 -07:00
block.rs Move 100 entries from tests/ui into subdirs 2024-05-20 19:55:59 -07:00
copy.rs Move 100 entries from tests/ui into subdirs 2024-05-20 19:55:59 -07:00
if-bot.rs [AUTO-GENERATED] Migrate ui tests from `//` to `//@` directives 2024-02-16 20:02:50 +00:00
if-generic.rs Move 100 entries from tests/ui into subdirs 2024-05-20 19:55:59 -07:00
if-panic-all.rs Move 100 entries from tests/ui into subdirs 2024-05-20 19:55:59 -07:00
issue-22933-1.rs Move some tests 2024-04-21 15:43:43 -03:00
issue-22933-2.rs Move some tests 2024-04-21 15:43:43 -03:00
issue-22933-2.stderr More accurate suggestions when writing wrong style of enum variant literal 2024-07-18 18:20:35 +00:00
scope.rs Move 100 entries from tests/ui into subdirs 2024-05-20 19:55:59 -07:00