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