]> git.lizzy.rs Git - rust.git/blob - src/test/ui/suggestions/field-access.stderr
a377f8f4deaef9fa75b443972f45d997a2bd66ba
[rust.git] / src / test / ui / suggestions / field-access.stderr
1 error[E0308]: mismatched types
2   --> $DIR/field-access.rs:12:12
3    |
4 LL |     Fst,
5    |     --- unit variant defined here
6 ...
7 LL |     if let B::Fst = a {};
8    |            ^^^^^^   - this expression has type `A`
9    |            |
10    |            expected struct `A`, found enum `B`
11    |
12 help: you might have meant to use field `b` of type `B`
13    |
14 LL |     if let B::Fst = a.b {};
15    |                     ^^^
16
17 error[E0308]: mismatched types
18   --> $DIR/field-access.rs:16:9
19    |
20 LL |     Fst,
21    |     --- unit variant defined here
22 ...
23 LL |     match a {
24    |           - this expression has type `A`
25 LL |         B::Fst => (),
26    |         ^^^^^^ expected struct `A`, found enum `B`
27    |
28 help: you might have meant to use field `b` of type `B`
29    |
30 LL |     match a.b {
31    |           ^^^
32
33 error[E0308]: mismatched types
34   --> $DIR/field-access.rs:17:9
35    |
36 LL |     Snd,
37    |     --- unit variant defined here
38 ...
39 LL |     match a {
40    |           - this expression has type `A`
41 LL |         B::Fst => (),
42 LL |         B::Snd => (),
43    |         ^^^^^^ expected struct `A`, found enum `B`
44    |
45 help: you might have meant to use field `b` of type `B`
46    |
47 LL |     match a.b {
48    |           ^^^
49
50 error: aborting due to 3 previous errors
51
52 For more information about this error, try `rustc --explain E0308`.