2021-01-28 14:43:35 -06:00
|
|
|
error[E0308]: mismatched types
|
2021-01-29 23:18:50 -06:00
|
|
|
--> $DIR/field-access.rs:20:12
|
2021-01-28 14:43:35 -06:00
|
|
|
|
|
|
|
|
LL | Fst,
|
|
|
|
| --- unit variant defined here
|
|
|
|
...
|
|
|
|
LL | if let B::Fst = a {};
|
|
|
|
| ^^^^^^ - this expression has type `A`
|
|
|
|
| |
|
2023-01-02 20:00:33 -06:00
|
|
|
| expected `A`, found `B`
|
2021-01-28 14:43:35 -06:00
|
|
|
|
|
2021-02-02 00:14:24 -06:00
|
|
|
help: you might have meant to use field `b` whose type is `B`
|
2021-01-28 14:43:35 -06:00
|
|
|
|
|
|
|
|
LL | if let B::Fst = a.b {};
|
2021-06-21 21:07:19 -05:00
|
|
|
| ~~~
|
2021-01-28 14:43:35 -06:00
|
|
|
|
2021-01-29 01:28:53 -06:00
|
|
|
error[E0308]: mismatched types
|
2021-01-29 23:18:50 -06:00
|
|
|
--> $DIR/field-access.rs:25:9
|
2021-01-29 01:28:53 -06:00
|
|
|
|
|
|
|
|
LL | Fst,
|
|
|
|
| --- unit variant defined here
|
|
|
|
...
|
|
|
|
LL | match a {
|
|
|
|
| - this expression has type `A`
|
2021-01-29 22:42:01 -06:00
|
|
|
...
|
2021-01-29 01:28:53 -06:00
|
|
|
LL | B::Fst => (),
|
2023-01-02 20:00:33 -06:00
|
|
|
| ^^^^^^ expected `A`, found `B`
|
2021-01-29 01:28:53 -06:00
|
|
|
|
|
2021-02-02 00:14:24 -06:00
|
|
|
help: you might have meant to use field `b` whose type is `B`
|
2021-01-29 01:28:53 -06:00
|
|
|
|
|
|
|
|
LL | match a.b {
|
2021-06-21 21:07:19 -05:00
|
|
|
| ~~~
|
2021-01-29 01:28:53 -06:00
|
|
|
|
|
|
|
error[E0308]: mismatched types
|
2021-01-29 23:18:50 -06:00
|
|
|
--> $DIR/field-access.rs:26:9
|
2021-01-29 01:28:53 -06:00
|
|
|
|
|
|
|
|
LL | Snd,
|
|
|
|
| --- unit variant defined here
|
|
|
|
...
|
|
|
|
LL | match a {
|
|
|
|
| - this expression has type `A`
|
2021-01-29 22:42:01 -06:00
|
|
|
...
|
2021-01-29 01:28:53 -06:00
|
|
|
LL | B::Snd => (),
|
2023-01-02 20:00:33 -06:00
|
|
|
| ^^^^^^ expected `A`, found `B`
|
2021-01-29 01:28:53 -06:00
|
|
|
|
|
2021-02-02 00:14:24 -06:00
|
|
|
help: you might have meant to use field `b` whose type is `B`
|
2021-01-29 01:28:53 -06:00
|
|
|
|
|
|
|
|
LL | match a.b {
|
2021-06-21 21:07:19 -05:00
|
|
|
| ~~~
|
2021-01-29 01:28:53 -06:00
|
|
|
|
2021-01-29 23:18:50 -06:00
|
|
|
error[E0308]: mismatched types
|
|
|
|
--> $DIR/field-access.rs:32:9
|
|
|
|
|
|
|
|
|
LL | match foo {
|
|
|
|
| --- this expression has type `Foo`
|
|
|
|
LL |
|
|
|
|
LL | 1u32 => (),
|
2023-01-02 20:00:33 -06:00
|
|
|
| ^^^^ expected `Foo`, found `u32`
|
2021-01-29 23:18:50 -06:00
|
|
|
|
|
2021-02-02 00:14:24 -06:00
|
|
|
help: you might have meant to use field `bar` whose type is `u32`
|
2021-01-29 23:18:50 -06:00
|
|
|
|
|
|
|
|
LL | match unsafe { foo.bar } {
|
2021-06-21 21:07:19 -05:00
|
|
|
| ~~~~~~~~~~~~~~~~~~
|
2021-01-29 23:18:50 -06:00
|
|
|
|
|
|
|
error: aborting due to 4 previous errors
|
2021-01-28 14:43:35 -06:00
|
|
|
|
|
|
|
For more information about this error, try `rustc --explain E0308`.
|