]> git.lizzy.rs Git - rust.git/blob - tests/ui/suggestions/field-access.stderr
Rollup merge of #106670 - albertlarsan68:check-docs-in-pr-ci, r=Mark-Simulacrum
[rust.git] / tests / ui / suggestions / field-access.stderr
1 error[E0308]: mismatched types
2   --> $DIR/field-access.rs:20: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` whose type is `B`
13    |
14 LL |     if let B::Fst = a.b {};
15    |                     ~~~
16
17 error[E0308]: mismatched types
18   --> $DIR/field-access.rs:25:9
19    |
20 LL |     Fst,
21    |     --- unit variant defined here
22 ...
23 LL |     match a {
24    |           - this expression has type `A`
25 ...
26 LL |         B::Fst => (),
27    |         ^^^^^^ expected struct `A`, found enum `B`
28    |
29 help: you might have meant to use field `b` whose type is `B`
30    |
31 LL |     match a.b {
32    |           ~~~
33
34 error[E0308]: mismatched types
35   --> $DIR/field-access.rs:26:9
36    |
37 LL |     Snd,
38    |     --- unit variant defined here
39 ...
40 LL |     match a {
41    |           - this expression has type `A`
42 ...
43 LL |         B::Snd => (),
44    |         ^^^^^^ expected struct `A`, found enum `B`
45    |
46 help: you might have meant to use field `b` whose type is `B`
47    |
48 LL |     match a.b {
49    |           ~~~
50
51 error[E0308]: mismatched types
52   --> $DIR/field-access.rs:32:9
53    |
54 LL |     match foo {
55    |           --- this expression has type `Foo`
56 LL |
57 LL |         1u32 => (),
58    |         ^^^^ expected union `Foo`, found `u32`
59    |
60 help: you might have meant to use field `bar` whose type is `u32`
61    |
62 LL |     match unsafe { foo.bar } {
63    |           ~~~~~~~~~~~~~~~~~~
64
65 error: aborting due to 4 previous errors
66
67 For more information about this error, try `rustc --explain E0308`.