2018-08-08 07:28:26 -05:00
|
|
|
error[E0063]: missing field `present` in initializer of `Foo`
|
2018-12-25 09:56:47 -06:00
|
|
|
--> $DIR/struct-field-cfg.rs:7:13
|
2018-08-08 07:28:26 -05:00
|
|
|
|
|
|
|
|
LL | let _ = Foo { #[cfg(any())] present: () };
|
|
|
|
| ^^^ missing `present`
|
|
|
|
|
|
|
|
error[E0560]: struct `Foo` has no field named `absent`
|
2018-12-25 09:56:47 -06:00
|
|
|
--> $DIR/struct-field-cfg.rs:10:46
|
2018-08-08 07:28:26 -05:00
|
|
|
|
|
|
|
|
LL | let _ = Foo { present: (), #[cfg(all())] absent: () };
|
|
|
|
| ^^^^^^ `Foo` does not have this field
|
|
|
|
|
|
2023-06-05 15:59:41 -05:00
|
|
|
= note: all struct fields are already assigned
|
2018-08-08 07:28:26 -05:00
|
|
|
|
|
|
|
error[E0027]: pattern does not mention field `present`
|
2018-12-25 09:56:47 -06:00
|
|
|
--> $DIR/struct-field-cfg.rs:13:9
|
2018-08-08 07:28:26 -05:00
|
|
|
|
|
|
|
|
LL | let Foo { #[cfg(any())] present: () } = foo;
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing field `present`
|
2020-09-11 15:47:33 -05:00
|
|
|
|
|
|
|
|
help: include the missing field in the pattern
|
|
|
|
|
|
|
|
|
LL | let Foo { present } = foo;
|
2021-06-21 21:07:19 -05:00
|
|
|
| ~~~~~~~~~~~
|
2020-11-05 21:55:58 -06:00
|
|
|
help: if you don't care about this missing field, you can explicitly ignore it
|
2020-09-11 15:47:33 -05:00
|
|
|
|
|
|
|
|
LL | let Foo { .. } = foo;
|
2021-06-21 21:07:19 -05:00
|
|
|
| ~~~~~~
|
2018-08-08 07:28:26 -05:00
|
|
|
|
|
|
|
error[E0026]: struct `Foo` does not have a field named `absent`
|
2018-12-25 09:56:47 -06:00
|
|
|
--> $DIR/struct-field-cfg.rs:16:42
|
2018-08-08 07:28:26 -05:00
|
|
|
|
|
|
|
|
LL | let Foo { present: (), #[cfg(all())] absent: () } = foo;
|
2019-03-16 12:14:01 -05:00
|
|
|
| ^^^^^^ struct `Foo` does not have this field
|
2018-08-08 07:28:26 -05:00
|
|
|
|
|
|
|
error: aborting due to 4 previous errors
|
|
|
|
|
2019-04-17 12:26:38 -05:00
|
|
|
Some errors have detailed explanations: E0026, E0027, E0063, E0560.
|
2018-08-08 07:28:26 -05:00
|
|
|
For more information about an error, try `rustc --explain E0026`.
|