2019-04-18 11:35:11 -07:00
|
|
|
error: struct literals are not allowed here
|
|
|
|
--> $DIR/struct-literal-variant-in-if.rs:13:13
|
|
|
|
|
|
|
|
|
LL | if x == E::I { field1: true, field2: 42 } {}
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2019-10-23 22:20:58 -07:00
|
|
|
|
|
2019-05-02 15:53:09 -07:00
|
|
|
help: surround the struct literal with parentheses
|
2019-04-18 11:35:11 -07:00
|
|
|
|
|
|
|
|
LL | if x == (E::I { field1: true, field2: 42 }) {}
|
2021-06-21 19:07:19 -07:00
|
|
|
| + +
|
2019-04-18 11:35:11 -07:00
|
|
|
|
2019-04-18 23:58:57 +03:00
|
|
|
error: struct literals are not allowed here
|
|
|
|
--> $DIR/struct-literal-variant-in-if.rs:15:13
|
2019-04-18 11:35:11 -07:00
|
|
|
|
|
|
|
|
LL | if x == E::V { field: false } {}
|
2019-04-18 23:58:57 +03:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^
|
2019-10-23 22:20:58 -07:00
|
|
|
|
|
2019-05-02 15:53:09 -07:00
|
|
|
help: surround the struct literal with parentheses
|
2019-04-18 11:35:11 -07:00
|
|
|
|
|
2019-04-18 23:58:57 +03:00
|
|
|
LL | if x == (E::V { field: false }) {}
|
2021-06-21 19:07:19 -07:00
|
|
|
| + +
|
2019-04-18 11:35:11 -07:00
|
|
|
|
|
|
|
error: struct literals are not allowed here
|
2019-04-18 23:58:57 +03:00
|
|
|
--> $DIR/struct-literal-variant-in-if.rs:17:13
|
2019-04-18 11:35:11 -07:00
|
|
|
|
|
|
|
|
LL | if x == E::J { field: -42 } {}
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^
|
2019-10-23 22:20:58 -07:00
|
|
|
|
|
2019-05-02 15:53:09 -07:00
|
|
|
help: surround the struct literal with parentheses
|
2019-04-18 11:35:11 -07:00
|
|
|
|
|
|
|
|
LL | if x == (E::J { field: -42 }) {}
|
2021-06-21 19:07:19 -07:00
|
|
|
| + +
|
2019-04-18 11:35:11 -07:00
|
|
|
|
|
|
|
error: struct literals are not allowed here
|
2019-04-18 23:58:57 +03:00
|
|
|
--> $DIR/struct-literal-variant-in-if.rs:19:13
|
2019-04-18 11:35:11 -07:00
|
|
|
|
|
|
|
|
LL | if x == E::K { field: "" } {}
|
|
|
|
| ^^^^^^^^^^^^^^^^^^
|
2019-10-23 22:20:58 -07:00
|
|
|
|
|
2019-05-02 15:53:09 -07:00
|
|
|
help: surround the struct literal with parentheses
|
2019-04-18 11:35:11 -07:00
|
|
|
|
|
|
|
|
LL | if x == (E::K { field: "" }) {}
|
2021-06-21 19:07:19 -07:00
|
|
|
| + +
|
2019-04-18 11:35:11 -07:00
|
|
|
|
2022-10-25 20:15:15 +04:00
|
|
|
error[E0533]: expected value, found struct variant `E::V`
|
2019-04-18 11:35:11 -07:00
|
|
|
--> $DIR/struct-literal-variant-in-if.rs:10:13
|
2019-04-15 08:08:46 -07:00
|
|
|
|
|
|
|
|
LL | if x == E::V { field } {}
|
2020-08-09 21:24:05 -07:00
|
|
|
| ^^^^ not a value
|
2019-04-15 08:08:46 -07:00
|
|
|
|
|
|
|
error[E0308]: mismatched types
|
2019-04-18 11:35:11 -07:00
|
|
|
--> $DIR/struct-literal-variant-in-if.rs:10:20
|
2019-04-15 08:08:46 -07:00
|
|
|
|
|
|
|
|
LL | if x == E::V { field } {}
|
2021-02-04 17:36:06 -08:00
|
|
|
| ---------------^^^^^--
|
2019-09-26 17:16:34 -07:00
|
|
|
| | |
|
2019-11-15 09:37:01 -08:00
|
|
|
| | expected `()`, found `bool`
|
2019-09-26 17:16:34 -07:00
|
|
|
| expected this to be `()`
|
2019-04-15 08:08:46 -07:00
|
|
|
|
|
|
|
error[E0308]: mismatched types
|
2019-04-18 23:58:57 +03:00
|
|
|
--> $DIR/struct-literal-variant-in-if.rs:21:20
|
2019-04-15 08:08:46 -07:00
|
|
|
|
|
|
|
|
LL | let y: usize = ();
|
2019-11-18 21:00:24 -08:00
|
|
|
| ----- ^^ expected `usize`, found `()`
|
|
|
|
| |
|
|
|
|
| expected due to this
|
2019-04-15 08:08:46 -07:00
|
|
|
|
2019-04-18 23:58:57 +03:00
|
|
|
error: aborting due to 7 previous errors
|
2019-04-15 08:08:46 -07:00
|
|
|
|
2022-10-25 20:15:15 +04:00
|
|
|
Some errors have detailed explanations: E0308, E0533.
|
2019-04-15 08:08:46 -07:00
|
|
|
For more information about an error, try `rustc --explain E0308`.
|