File: struct-field-cfg.stderr

package info (click to toggle)
rustc 1.88.0%2Bdfsg1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 934,128 kB
  • sloc: xml: 158,127; python: 36,062; javascript: 19,855; sh: 19,700; cpp: 18,947; ansic: 12,993; asm: 4,792; makefile: 690; lisp: 29; perl: 29; ruby: 19; sql: 11
file content (46 lines) | stat: -rw-r--r-- 1,634 bytes parent folder | download | duplicates (11)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
error[E0063]: missing field `present` in initializer of `Foo`
  --> $DIR/struct-field-cfg.rs:7:13
   |
LL |     let _ = Foo { #[cfg(any())] present: () };
   |             ^^^ missing `present`

error[E0560]: struct `Foo` has no field named `absent`
  --> $DIR/struct-field-cfg.rs:10:46
   |
LL |     let _ = Foo { present: (), #[cfg(all())] absent: () };
   |                                              ^^^^^^ `Foo` does not have this field
   |
   = note: all struct fields are already assigned

error[E0027]: pattern does not mention field `present`
  --> $DIR/struct-field-cfg.rs:13:9
   |
LL |     let Foo { #[cfg(any())] present: () } = foo;
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing field `present`
   |
help: include the missing field in the pattern
   |
LL -     let Foo { #[cfg(any())] present: () } = foo;
LL +     let Foo { present } = foo;
   |
help: if you don't care about this missing field, you can explicitly ignore it
   |
LL -     let Foo { #[cfg(any())] present: () } = foo;
LL +     let Foo { present: _ } = foo;
   |
help: or always ignore missing fields here
   |
LL -     let Foo { #[cfg(any())] present: () } = foo;
LL +     let Foo { .. } = foo;
   |

error[E0026]: struct `Foo` does not have a field named `absent`
  --> $DIR/struct-field-cfg.rs:16:42
   |
LL |     let Foo { present: (), #[cfg(all())] absent: () } = foo;
   |                                          ^^^^^^ struct `Foo` does not have this field

error: aborting due to 4 previous errors

Some errors have detailed explanations: E0026, E0027, E0063, E0560.
For more information about an error, try `rustc --explain E0026`.