rust/tests/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 `A`, found `B`
|
help: you might have meant to use field `b` whose type is `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 `A`, found `B`
2021-01-29 07:28:53 +00:00
|
help: you might have meant to use field `b` whose type is `B`
2021-01-29 07:28:53 +00:00
|
LL | match 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: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 `A`, found `B`
2021-01-29 07:28:53 +00:00
|
help: you might have meant to use field `b` whose type is `B`
2021-01-29 07:28:53 +00:00
|
LL | match a.b {
| ~~~
2021-01-29 07:28:53 +00:00
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 `Foo`, found `u32`
2021-01-30 05:18:50 +00:00
|
help: you might have meant to use field `bar` whose type is `u32`
2021-01-30 05:18:50 +00:00
|
LL | match unsafe { foo.bar } {
| ~~~~~~~~~~~~~~~~~~
2021-01-30 05:18:50 +00:00
error: aborting due to 4 previous errors
For more information about this error, try `rustc --explain E0308`.