summaryrefslogtreecommitdiffstats
path: root/tests/ui/suggestions/field-access.stderr
blob: b9f0f788b8c3c3f025c7ffae0c6c02837bdfb503 (plain)
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
error[E0308]: mismatched types
  --> $DIR/field-access.rs:20:12
   |
LL |     Fst,
   |     --- unit variant defined here
...
LL |     if let B::Fst = a {};
   |            ^^^^^^   - this expression has type `A`
   |            |
   |            expected struct `A`, found enum `B`
   |
help: you might have meant to use field `b` whose type is `B`
   |
LL |     if let B::Fst = a.b {};
   |                     ~~~

error[E0308]: mismatched types
  --> $DIR/field-access.rs:25:9
   |
LL |     Fst,
   |     --- unit variant defined here
...
LL |     match a {
   |           - this expression has type `A`
...
LL |         B::Fst => (),
   |         ^^^^^^ expected struct `A`, found enum `B`
   |
help: you might have meant to use field `b` whose type is `B`
   |
LL |     match a.b {
   |           ~~~

error[E0308]: mismatched types
  --> $DIR/field-access.rs:26:9
   |
LL |     Snd,
   |     --- unit variant defined here
...
LL |     match a {
   |           - this expression has type `A`
...
LL |         B::Snd => (),
   |         ^^^^^^ expected struct `A`, found enum `B`
   |
help: you might have meant to use field `b` whose type is `B`
   |
LL |     match a.b {
   |           ~~~

error[E0308]: mismatched types
  --> $DIR/field-access.rs:32:9
   |
LL |     match foo {
   |           --- this expression has type `Foo`
LL |
LL |         1u32 => (),
   |         ^^^^ expected union `Foo`, found `u32`
   |
help: you might have meant to use field `bar` whose type is `u32`
   |
LL |     match unsafe { foo.bar } {
   |           ~~~~~~~~~~~~~~~~~~

error: aborting due to 4 previous errors

For more information about this error, try `rustc --explain E0308`.