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.

37 lines
1.2 KiB
Plaintext
Raw Normal View History

error[E0609]: no field `d` on type `&A`
2018-12-25 15:56:47 +00:00
--> $DIR/struct-pat-derived-error.rs:8:31
2018-08-08 12:28:26 +00:00
|
2019-03-09 12:03:44 +00:00
LL | let A { x, y } = self.d;
2023-11-09 06:01:10 +00:00
| ^ unknown field
|
help: a field with a similar name exists
|
LL | let A { x, y } = self.b;
| ~
2018-08-08 12:28:26 +00:00
error[E0026]: struct `A` does not have fields named `x`, `y`
2018-12-25 15:56:47 +00:00
--> $DIR/struct-pat-derived-error.rs:8:17
2018-08-08 12:28:26 +00:00
|
2019-03-09 12:03:44 +00:00
LL | let A { x, y } = self.d;
| ^ ^ struct `A` does not have these fields
2018-08-08 12:28:26 +00:00
error[E0027]: pattern does not mention fields `b`, `c`
2018-12-25 15:56:47 +00:00
--> $DIR/struct-pat-derived-error.rs:8:13
2018-08-08 12:28:26 +00:00
|
2019-03-09 12:03:44 +00:00
LL | let A { x, y } = self.d;
2018-08-08 12:28:26 +00: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 03:55:58 +00:00
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 12:28:26 +00:00
error: aborting due to 3 previous errors
Some errors have detailed explanations: E0026, E0027, E0609.
2018-08-08 12:28:26 +00:00
For more information about an error, try `rustc --explain E0026`.