rust/tests/ui/structs/struct-pat-derived-error.stderr

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

32 lines
1.1 KiB
Plaintext
Raw Normal View History

error[E0609]: no field `d` on type `&A`
2018-12-25 08:56:47 -07:00
--> $DIR/struct-pat-derived-error.rs:8:31
2018-08-08 14:28:26 +02:00
|
2019-03-09 15:03:44 +03:00
LL | let A { x, y } = self.d;
2019-09-28 14:39:19 +03:00
| ^ help: a field with a similar name exists: `b`
2018-08-08 14:28:26 +02:00
error[E0026]: struct `A` does not have fields named `x`, `y`
2018-12-25 08:56:47 -07:00
--> $DIR/struct-pat-derived-error.rs:8:17
2018-08-08 14:28:26 +02:00
|
2019-03-09 15:03:44 +03:00
LL | let A { x, y } = self.d;
| ^ ^ struct `A` does not have these fields
2018-08-08 14:28:26 +02:00
error[E0027]: pattern does not mention fields `b`, `c`
2018-12-25 08:56:47 -07:00
--> $DIR/struct-pat-derived-error.rs:8:13
2018-08-08 14:28:26 +02:00
|
2019-03-09 15:03:44 +03:00
LL | let A { x, y } = self.d;
2018-08-08 14:28:26 +02:00
| ^^^^^^^^^^ missing fields `b`, `c`
|
help: include the missing fields in the pattern
|
LL | let A { x, y, b, c } = self.d;
| ~~~~~~~~
2020-11-06 09:25:58 +05:30
help: if you don't care about these missing fields, you can explicitly ignore them
|
LL | let A { x, y, .. } = self.d;
| ~~~~~~
2018-08-08 14:28:26 +02:00
error: aborting due to 3 previous errors
Some errors have detailed explanations: E0026, E0027, E0609.
2018-08-08 14:28:26 +02:00
For more information about an error, try `rustc --explain E0026`.