os-rust/src/test/ui/suggestions/field-access.stderr

54 lines
1.3 KiB
Text
Raw Normal View History

error[E0308]: mismatched types
2021-01-29 16:33:15 +09:00
--> $DIR/field-access.rs:15: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` of type `B`
|
LL | if let B::Fst = a.b {};
| ^^^
2021-01-29 16:28:53 +09:00
error[E0308]: mismatched types
2021-01-30 13:42:01 +09:00
--> $DIR/field-access.rs:20:9
2021-01-29 16:28:53 +09:00
|
LL | Fst,
| --- unit variant defined here
...
LL | match a {
| - this expression has type `A`
2021-01-30 13:42:01 +09:00
...
2021-01-29 16:28:53 +09:00
LL | B::Fst => (),
| ^^^^^^ expected struct `A`, found enum `B`
|
help: you might have meant to use field `b` of type `B`
|
LL | match a.b {
| ^^^
error[E0308]: mismatched types
2021-01-30 13:42:01 +09:00
--> $DIR/field-access.rs:21:9
2021-01-29 16:28:53 +09:00
|
LL | Snd,
| --- unit variant defined here
...
LL | match a {
| - this expression has type `A`
2021-01-30 13:42:01 +09:00
...
2021-01-29 16:28:53 +09:00
LL | B::Snd => (),
| ^^^^^^ expected struct `A`, found enum `B`
|
help: you might have meant to use field `b` of type `B`
|
LL | match a.b {
| ^^^
error: aborting due to 3 previous errors
For more information about this error, try `rustc --explain E0308`.