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

68 lines
1.6 KiB
Plaintext
Raw Normal View History

error[E0308]: mismatched types
2021-01-30 05:18:50 +00:00
--> $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` of type `B`
|
LL | if let B::Fst = a.b {};
| ^^^
2021-01-29 07:28:53 +00:00
error[E0308]: mismatched types
2021-01-30 05:18:50 +00:00
--> $DIR/field-access.rs:25:9
2021-01-29 07:28:53 +00:00
|
LL | Fst,
| --- unit variant defined here
...
LL | match a {
| - this expression has type `A`
2021-01-30 04:42:01 +00:00
...
2021-01-29 07:28:53 +00: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 05:18:50 +00:00
--> $DIR/field-access.rs:26:9
2021-01-29 07:28:53 +00:00
|
LL | Snd,
| --- unit variant defined here
...
LL | match a {
| - this expression has type `A`
2021-01-30 04:42:01 +00:00
...
2021-01-29 07:28:53 +00: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 {
| ^^^
2021-01-30 05:18:50 +00:00
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` of type `u32`
|
LL | match unsafe { foo.bar } {
| ^^^^^^^^^^^^^^^^^^
error: aborting due to 4 previous errors
For more information about this error, try `rustc --explain E0308`.