Rust

E0560 Struct Has No Field Named Fix

A struct literal is a list of the struct's own field names, and every name on the list has to be one the struct declares. Write a name the struct does not have — a field you meant to add and did not, a spelling that drifted from the declaration, a field left over from an older version of the struct — and the compiler stops with E0560, struct has no field named, underlining the name it does not know. The fix is always a choice between two sides of the same mismatch: change the literal to match the struct, or change the struct to match the literal. This guide shows the error in its common shapes, explains why the label under the span changes between two wordings, and separates the four nearby errors that put a bad field name in a different place and carry different codes.

Written November 27, 2026 · Tested with Rust 1.99.1 · 26 min read

By the end of this guide
  • The error: a field the struct does not have
  • First fix: delete the extra field from the literal
  • Second fix: add the field to the struct
  • A misspelled field: the compiler suggests the declared name

Written November 27, 2026

Tested with Rust 1.99.1

What this guide is

E0560 is the error for a field name in a struct literal that the struct does not declare. A struct literal — the compiler calls it a struct expression — names each field it sets, and the set of names it may use is exactly the set of fields on the struct definition. A name outside that set has nothing to bind to. There is no slot for its value to go into, so the compiler refuses the whole literal, however correct the rest of it is. The value written for the bad field does not matter, and neither does its type: the name alone is the error.

Three questions decide the repair, and the diagnostic answers the first two if you read all of it. Is the name a misspelling of a field the struct does have? Then the compiler usually says so, in a help block that names the field it thinks you meant. Is the name a field the struct should have? Then the struct definition is the side that is wrong, and the fix is to add the field there. Or is the name a leftover, a field the value does not need? Then the literal is the side that is wrong, and the fix is to delete the name and its value. The sections below take the shapes in order: the plain extra field, the two repairs on that shape, the misspelling with its suggestion, the case where a bad field and a missing field arrive together and the diagnostic changes its wording, tuple structs, update syntax, and generic structs. Then the four neighboring errors, and the exact rule with its sources.

The error: a field the struct does not have

This program declares a two-field struct and writes a three-field literal:

Rust
struct Point {
    x: i32,
    y: i32,
}

fn main() {
    let p = Point { x: 1, y: 2, z: 3 };
    println!("{} {}", p.x, p.y);
}
Terminal
$ rustc --edition 2021 main.rs -o main.bin
error[E0560]: struct `Point` has no field named `z`
 --> main.rs:7:33
  |
7 |     let p = Point { x: 1, y: 2, z: 3 };
  |                                 ^ `Point` does not have this field
  |
  = note: all struct fields are already assigned

error: aborting due to 1 previous error

For more information about this error, try `rustc --explain E0560`.

The header names the code, the struct, and the field: error[E0560], struct Point has no field named z. The span underlines the one name, z, and its label reads: Point does not have this field. Below the span sits a note that is easy to skim past and worth reading, because it carries information: all struct fields are already assigned. That note means the literal was already complete before the bad name arrived. Every real field has a value, so z is purely extra — it is not standing in for a field that still needs one. That fact points at the repair. Either z is a leftover and comes out, or the struct is missing a field it should have and z goes into the definition. The next two sections take those in turn.

If a literal names two unknown fields, each one gets its own E0560 with its own span, and the closing line counts both: aborting due to 2 previous errors. There is no first-error-only behavior here, so a long literal can be repaired in one pass by working through every span the compiler prints.

First fix: delete the extra field from the literal

When the struct is right and the literal carries a name the value does not need, delete the name and its value. The literal then names exactly the declared fields:

Rust
struct Point {
    x: i32,
    y: i32,
}

fn main() {
    let p = Point { x: 1, y: 2 };
    println!("{} {}", p.x, p.y);
}
Terminal
$ rustc --edition 2021 main.rs -o main.bin
$ ./main.bin
1 2

The program prints 1 2 and exits with status 0. Choose this fix when the note says all struct fields are already assigned and the extra name is not a misspelling of one of them. That combination means the value was already fully described without the extra field, so the field's value was never going to be read anywhere. Leftovers like this usually arrive from copying a literal from a wider struct, or from removing a field from the definition and missing one of its construction sites. Deleting the name at the construction site finishes the removal the definition started.

Second fix: add the field to the struct

When the literal is right — the value genuinely has a third component that the rest of the program will use — the definition is the side that is behind. Add the field to the struct, and the same literal compiles unchanged:

Rust
struct Point {
    x: i32,
    y: i32,
    z: i32,
}

fn main() {
    let p = Point { x: 1, y: 2, z: 3 };
    println!("{} {} {}", p.x, p.y, p.z);
}
Terminal
$ rustc --edition 2021 main.rs -o main.bin
$ ./main.bin
1 2 3

The program prints 1 2 3 and exits with status 0. The print line here reads p.z as well, which is part of the check on this fix: a field added to satisfy one literal has to earn its place by being used, or it will sit unread in every value. Adding a field also reaches further than one literal. Every other construction site for the same struct now owes a value for the new field, and each site that does not provide one fails with E0063, missing field, until it is updated or given update syntax. That is the honest cost of this fix, and it is the right cost when the field is real: the compiler walks you to every place the wider value is built. When the field is not real, the deletion fix above is the one that stays local.

A misspelled field: the compiler suggests the declared name

The most common single cause of this error is a spelling that drifted between the definition and the literal. When a declared field is close to the name written, the diagnostic changes shape. The label under the span becomes the shorter unknown field, the all-assigned note disappears, and a help block offers the correction:

Rust
struct Style {
    color: String,
}

fn main() {
    let s = Style { colour: String::from("red") };
    println!("{}", s.color);
}
Terminal
$ rustc --edition 2021 main.rs -o main.bin
error[E0560]: struct `Style` has no field named `colour`
 --> main.rs:6:21
  |
6 |     let s = Style { colour: String::from("red") };
  |                     ^^^^^^ unknown field
  |
help: a field with a similar name exists
  |
6 -     let s = Style { colour: String::from("red") };
6 +     let s = Style { color: String::from("red") };
  |

error: aborting due to 1 previous error

For more information about this error, try `rustc --explain E0560`.

The help block shows the line twice, the written form with a minus sign and the corrected form with a plus sign, differing only in the field name: colour out, color in. Accepting that change is the whole fix:

Rust
struct Style {
    color: String,
}

fn main() {
    let s = Style { color: String::from("red") };
    println!("{}", s.color);
}
Terminal
$ rustc --edition 2021 main.rs -o main.bin
$ ./main.bin
red

The program prints red and exits with status 0. Two cautions about the suggestion. First, it appears only when a declared field is close enough to the written name; a name with no near match gets the plain label and no help block, as the first section showed. Second, read the suggestion before applying it. The compiler is matching spellings, not intentions, and where two fields are both close to the written name it offers one of them. If the value being assigned belongs to the other field, applying the suggestion compiles the literal and stores the value in the wrong place. The suggestion is a strong hint about spelling, and the field's meaning is still yours to check.

A bad field and a missing field together: the note disappears

A literal can be wrong in both directions at once: it names a field the struct does not have, and it leaves out a field the struct does have. Only the unknown name is reported as E0560, and its diagnostic differs from the first section's in two ways:

Rust
struct Point {
    x: i32,
    y: i32,
}

fn main() {
    let p = Point { x: 1, z: 3 };
    println!("{} {}", p.x, p.y);
}
Terminal
$ rustc --edition 2021 main.rs -o main.bin
error[E0560]: struct `Point` has no field named `z`
 --> main.rs:7:27
  |
7 |     let p = Point { x: 1, z: 3 };
  |                           ^ unknown field
  |
help: a field with a similar name exists
  |
7 -     let p = Point { x: 1, z: 3 };
7 +     let p = Point { x: 1, y: 3 };
  |

error: aborting due to 1 previous error

For more information about this error, try `rustc --explain E0560`.

Compare this with the first section line by line. The header is identical. The label under the span is now unknown field instead of Point does not have this field, and the note about all fields being assigned is gone — correctly, because it is no longer true: y has no value in this literal. In its place the help block suggests y as the similar name, and here the suggestion and the missing field are the same fact seen from two sides. The name z is close to y, and y is the field still waiting for a value, so renaming z to y repairs both faults with one change. That will not always be the shape of it. If the unknown name is not close to the missing field, no suggestion appears, and the repair is two separate changes: deal with the unknown name on its own terms, then supply the missing field — at which point, if the unknown name is still present, the error returns in its first-section form, note and all. Note also what is absent from this output: there is no separate missing-field error alongside the E0560. While a literal contains an unknown name, that is the error reported for it.

A tuple struct written with braces

Tuple structs have no field names. Their components are numbered, and they are constructed with parentheses, like a function call. Writing one with braces and a name fails with E0560, and the diagnostic says what the type is:

Rust
struct Pair(i32, i32);

fn main() {
    let p = Pair { x: 1 };
    println!("{}", p.0);
}
Terminal
$ rustc --edition 2021 main.rs -o main.bin
error[E0560]: struct `Pair` has no field named `x`
 --> main.rs:4:20
  |
1 | struct Pair(i32, i32);
  |        ---- `Pair` defined here
...
4 |     let p = Pair { x: 1 };
  |                    ^ field does not exist
  |
help: `Pair` is a tuple struct, use the appropriate syntax
  |
4 -     let p = Pair { x: 1 };
4 +     let p = Pair(/* i32 */, /* i32 */);
  |

error: aborting due to 1 previous error

For more information about this error, try `rustc --explain E0560`.

This diagnostic carries a third label wording, field does not exist, and a second span pointing back at the definition, labeled Pair defined here. The help block is not a rename but a change of construction syntax: parentheses, with a placeholder for each component in order. Following it, with real values in the placeholders, gives the working form:

Rust
struct Pair(i32, i32);

fn main() {
    let p = Pair(1, 2);
    println!("{} {}", p.0, p.1);
}
Terminal
$ rustc --edition 2021 main.rs -o main.bin
$ ./main.bin
1 2

The program prints 1 2 and exits with status 0, and the components are read back by number, p.0 and p.1, since numbers are the only names a tuple struct has. If the values genuinely need names — if x and y mean something a reader should see — the other repair is to change the type: rewrite the tuple struct as a braced struct with named fields, and the original brace literal becomes correct. That is a change to every construction and access site for the type, so it is worth doing only when the names carry meaning the numbers do not. A unit struct, one declared with no fields and no parentheses, behaves like the first section: a braced literal naming any field fails with E0560, with the does-not-have-this-field label and the all-assigned note, because a fieldless struct is trivially fully assigned.

A bad field next to update syntax

Functional update syntax — a .. followed by a value of the same type, supplying the fields the literal does not name — does not widen the set of names the literal may use. A bad name next to the .. is still E0560:

Rust
struct Point {
    x: i32,
    y: i32,
}

fn main() {
    let a = Point { x: 1, y: 2 };
    let p = Point { z: 3, ..a };
    println!("{} {}", p.x, p.y);
}
Terminal
$ rustc --edition 2021 main.rs -o main.bin
error[E0560]: struct `Point` has no field named `z`
 --> main.rs:8:21
  |
8 |     let p = Point { z: 3, ..a };
  |                     ^ unknown field
  |
help: a field with a similar name exists
  |
8 -     let p = Point { z: 3, ..a };
8 +     let p = Point { x: 3, ..a };
  |

error: aborting due to 1 previous error

For more information about this error, try `rustc --explain E0560`.

The label is unknown field and there is no all-assigned note, even though the ..a would have supplied every real field: the note belongs to literals that name all the fields themselves. The same result holds when the base is ..Default::default() on a struct that derives Default — the bad name fails identically, with the same suggestion. The suggestion here, renaming z to x, is also the working repair in this shape, because the update syntax then supplies only the remaining field:

Rust
struct Point {
    x: i32,
    y: i32,
}

fn main() {
    let a = Point { x: 1, y: 2 };
    let p = Point { x: 9, ..a };
    println!("{} {}", p.x, p.y);
}
Terminal
$ rustc --edition 2021 main.rs -o main.bin
$ ./main.bin
9 2

The program prints 9 2 and exits with status 0: the named field takes its value from the literal, and the unnamed field moves across from the base value. The general lesson is that update syntax fills in fields; it never excuses names. Every name written before the .. still has to be a declared field, checked exactly as it would be in a literal with no base.

A generic struct: the header shows the parameter as an underscore

Generic parameters change nothing about which names a literal may use, but they do change the header's spelling of the struct's name, and the suggestion's shape along with it:

Rust
struct Wrapper<T> {
    value: T,
}

fn main() {
    let w = Wrapper { valu: 42 };
    println!("{}", w.value);
}
Terminal
$ rustc --edition 2021 main.rs -o main.bin
error[E0560]: struct `Wrapper<_>` has no field named `valu`
 --> main.rs:6:23
  |
6 |     let w = Wrapper { valu: 42 };
  |                       ^^^^ unknown field
  |
help: a field with a similar name exists
  |
6 |     let w = Wrapper { value: 42 };
  |                           +

error: aborting due to 1 previous error

For more information about this error, try `rustc --explain E0560`.

The struct is named Wrapper<_> in the header: the underscore stands for the type parameter, whose concrete type nothing in this literal settles — the only field's name is wrong, so no value ever fixes T. (Where a correctly written field in the same literal does fix a parameter, the header prints that type instead, as in Wrapper<{integer}>; only unsettled parameters appear as underscores.) Field names are checked against the definition, not against any particular T. The help block also changes form. Because the fix is a pure insertion, one missing letter, the suggestion shows a single line with a plus marker under the place where the e goes, instead of the minus-and-plus line pair the earlier sections showed. Applying it gives the ordinary working literal:

Rust
struct Wrapper<T> {
    value: T,
}

fn main() {
    let w = Wrapper { value: 42 };
    println!("{}", w.value);
}
Terminal
$ rustc --edition 2021 main.rs -o main.bin
$ ./main.bin
42

The program prints 42 and exits with status 0. Field-name errors are among the earliest checks a literal goes through, which is why nothing in this section's output mentions T, inference, or the value's type. If the name is right and the value is wrong for the field, that is a separate, later error with its own code, and it appears only once every name in the literal is a declared field.

Neighboring error: the same bad name on an enum variant is E0559

A struct-like enum variant is constructed with the same brace syntax, and a bad field name in it looks like the same mistake. It carries the neighboring code, not this one:

Rust
enum Shape {
    Circle { radius: f64 },
}

fn main() {
    let s = Shape::Circle { raduis: 1.0 };
    println!("{:?}", std::mem::discriminant(&s));
}
Terminal
$ rustc --edition 2021 main.rs -o main.bin
error[E0559]: variant `Shape::Circle` has no field named `raduis`
 --> main.rs:6:29
  |
6 |     let s = Shape::Circle { raduis: 1.0 };
  |                             ^^^^^^ unknown field
  |
help: a field with a similar name exists
  |
6 -     let s = Shape::Circle { raduis: 1.0 };
6 +     let s = Shape::Circle { radius: 1.0 };
  |

error: aborting due to 1 previous error

For more information about this error, try `rustc --explain E0559`.

The code is E0559, and the header says variant where E0560 says struct: variant Shape::Circle has no field named raduis. Everything else about the shape of the diagnostic — the unknown field label, the similar-name help with the line pair — matches the misspelling section above, and the repair matches too: rename the field to the variant's declared name, or add the field to the variant. What decides the code is what the path before the braces names. A struct name gives E0560; an enum variant path gives E0559. When the header's first word surprises you, check which of the two you actually wrote.

Neighboring error: a bad field name in a pattern is E0026

Patterns use the same names in the opposite direction, taking a value apart instead of building one, and a name the struct does not have is refused there too — under a third code, and with a second error riding along:

Rust
struct Point {
    x: i32,
    y: i32,
}

fn main() {
    let p = Point { x: 1, y: 2 };
    let Point { z } = p;
    println!("{}", z);
}
Terminal
$ rustc --edition 2021 main.rs -o main.bin
error[E0026]: struct `Point` does not have a field named `z`
 --> main.rs:8:17
  |
8 |     let Point { z } = p;
  |                 ^ struct `Point` does not have this field

error[E0027]: pattern does not mention fields `x`, `y`
 --> main.rs:8:9
  |
8 |     let Point { z } = p;
  |         ^^^^^^^^^^^ missing fields `x`, `y`
  |
help: include the missing fields in the pattern
  |
8 |     let Point { z, x, y } = p;
  |                  ++++++
help: if you don't care about these missing fields, you can explicitly ignore them
  |
8 |     let Point { z, x: _, y: _ } = p;
  |                  ++++++++++++
help: or always ignore missing fields here
  |
8 |     let Point { z, .. } = p;
  |                  ++++

error: aborting due to 2 previous errors

Some errors have detailed explanations: E0026, E0027.
For more information about an error, try `rustc --explain E0026`.

The bad name itself is E0026: struct Point does not have a field named z — note the header's wording, does not have a field named, against E0560's has no field named. The second error, E0027, is about the pattern's other obligation: a pattern must account for every field, by naming it or by ending with .., and this one mentions neither real field. Its help blocks are written as if the bad name were staying, which it should not: the real repair is to name the fields that exist, let Point { x, y } = p;, or the ones you need plus ... The split to remember is by context, not by name. Building a value with a bad name is E0560 (or E0559 for a variant); taking a value apart with a bad name is E0026, usually with E0027 beside it.

Neighboring error: reading a field that is not there is E0609

Construction is not the only place a wrong field name appears. Reading a field through dot syntax on a value that already exists is a different operation, and it has its own code:

Rust
struct Point {
    x: i32,
    y: i32,
}

fn main() {
    let p = Point { x: 1, y: 2 };
    println!("{}", p.z);
}
Terminal
$ rustc --edition 2021 main.rs -o main.bin
error[E0609]: no field `z` on type `Point`
 --> main.rs:8:22
  |
8 |     println!("{}", p.z);
  |                      ^ unknown field
  |
help: a field with a similar name exists
  |
8 -     println!("{}", p.z);
8 +     println!("{}", p.x);
  |

error: aborting due to 1 previous error

For more information about this error, try `rustc --explain E0609`.

The code is E0609: no field z on type Point. The literal in this program is entirely correct; the bad name sits in an access expression, p.z, and access expressions are checked against the value's type at the point of access, under their own code. The similar-name help appears here as well, offering x. The practical difference matters when you are searching for help or reading a report: E0560 always means the bad name was written while building the value, in the braces of a literal, and E0609 always means it was written while reading from a finished value, after a dot. A rename of a field in the definition produces both codes across a codebase — E0560 at the construction sites, E0609 at the read sites — and each site is repaired by the same rename applied at that site.

Neighboring error: a field left out is E0063

The mirror fault — a literal that names only real fields, but not all of them, and has no update syntax to supply the rest — is not E0560 either:

Rust
struct Point {
    x: i32,
    y: i32,
}

fn main() {
    let p = Point { x: 1 };
    println!("{} {}", p.x, p.y);
}
Terminal
$ rustc --edition 2021 main.rs -o main.bin
error[E0063]: missing field `y` in initializer of `Point`
 --> main.rs:7:13
  |
7 |     let p = Point { x: 1 };
  |             ^^^^^ missing `y`

error: aborting due to 1 previous error

For more information about this error, try `rustc --explain E0063`.

The code is E0063: missing field y in initializer of Point, and the span covers the struct's name rather than any one field, with the label naming the field that is missing. Set the two codes side by side and the boundary is exact. E0560 is about a name that is present and should not be: every name in the literal must be a declared field. E0063 is about a name that is absent and should be present: every declared field must be accounted for, by a name in the literal or by update syntax. A literal can only be charged with one of them at a time in practice, because while an unknown name is present the compiler reports E0560 for it and does not also report the fields it crowds out, as the combined case above showed. Repair the unknown name first; if a field is then still missing, E0063 appears and names it.

The exact rule: a literal may name only declared fields

The official page for E0560 states the rule in its first line: an unknown field was specified into a structure. Its erroneous example is a struct Simba with one field, mother, constructed with a second name, father, that the struct does not declare — the first section's shape with different names. Its advice is the fork this guide is built on, stated as one sentence: verify you didn't misspell the field's name or that the field exists. Misspelling first, existence second: check the name against the definition, and if the name is the one you intended, make it exist by adding it to the definition. The page carries no note retiring or replacing this code; E0560 is the current code for this fault.

The Reference's page on struct expressions supplies the surrounding mechanics. A struct expression creates a struct, enum, or union value from a path to the item followed by the values for its fields, with each field name separated from its value by a colon, in any order. The same page covers the two constructions this guide's shapes depend on. A struct expression can end with .. and a base expression of the same type, and it then uses the given values for the fields that were specified and moves or copies the remaining fields from the base — which is why update syntax supplies unnamed fields but says nothing about the names that are written. And tuple structs are typically instantiated with a call expression, parentheses, referring to the constructor, as distinct from a struct expression with curly braces — which is why the brace form on a tuple struct has no names to check a written name against, and fails.

The fixes, ranked

  • First, if the help block offers a similar name and it is the field you meant, take the rename. A misspelling is the most common cause of this error, the suggestion is the compiler reading the definition for you, and the change is one word at one site. Check the offered field is the one the value belongs to before applying it.
  • Second, if every real field already has a value — the all-assigned note is present — and the extra name is no misspelling, delete the name and its value from the literal. The value was complete without it.
  • Third, if the value genuinely needs the field, add the field to the struct definition, then work through the E0063 errors that appear at the struct's other construction sites until each one supplies the new field or takes it from update syntax.
  • Fourth, on a tuple struct, switch the construction to parentheses with values in order. Change the type to a named-field struct instead only when the field names carry meaning worth a type-wide change.
  • Fifth, in update syntax, repair the written names exactly as in a plain literal, and let the .. base do only its own job of supplying the fields you did not write.

Which fix for which cause

  • Literal names an extra field, all declared fields already assigned, no similar name offered: E0560, label Point does not have this field, note all struct fields are already assigned. Delete the name from the literal, or add the field to the struct if the value needs it.
  • Literal misspells a declared field: E0560, label unknown field, help block offering the similar name. Rename the field in the literal to the declared spelling.
  • Literal names an unknown field and leaves a declared field out: E0560 only, no all-assigned note. If the unknown name is close to the missing field, label unknown field with the similar-name help; if it is not close to any declared field, label Point does not have this field, with the note 'available fields are:' naming the fields still unassigned, and no help block. If the unknown name is the missing field misspelled, rename it; otherwise remove the unknown name and supply the missing field.
  • Literal names two or more unknown fields: one E0560 per unknown name, each with its own span. Repair each name on its own terms in the same pass.
  • Braced literal with a name on a tuple struct: E0560, label field does not exist, help offering the parenthesized form. Construct with parentheses, or convert the type to named fields.
  • Braced literal with a name on a unit struct: E0560, label does not have this field, with the all-assigned note. Remove the braces' contents, or give the struct the field.
  • Bad name beside ..base or ..Default::default(): E0560; label unknown field with a similar-name help when a declared field is close, otherwise label Point does not have this field with the note 'available fields are:' listing every field. Update syntax supplies missing fields only; rename or remove the written name.
  • Bad name in a literal for a generic struct: E0560, header names the struct with each unsettled parameter as an underscore, such as Wrapper<_>. Rename or remove the name; the type parameter is not involved.
  • Bad name in a union literal: E0560, header says union has no field named. Rename the name to one of the union's declared fields; a union literal names exactly one field.
  • Bad name in a struct-like enum variant literal: E0559, header says variant has no field named. Rename the field to the variant's declared name, or add it to the variant.
  • Bad name in a struct pattern: E0026, with E0027 if the pattern also leaves fields unmentioned. Name the fields that exist, and end with .. if you do not need them all.
  • Bad name after a dot, reading a value: E0609, no field on type. Rename the access to a declared field.
  • Declared field left out of a literal with no update syntax: E0063, missing field in initializer. Add the field and its value, or add update syntax with a base that has it.

Checklist

  • Read the whole diagnostic, not just the header. The label under the span and the presence or absence of the all-assigned note tell you which shape you have: does not have this field with the note means purely extra; unknown field appears when a similar name is offered below; when no declared field is close enough for a suggestion, the label is does not have this field and the note instead lists the fields still unassigned after 'available fields are:' — read that list, it names exactly what the literal still owes.
  • Decide which side is wrong before editing. The literal and the definition cannot both be right when this error appears, and the repairs for the two sides are opposites: rename or delete in the literal, or add the field to the definition and update the other construction sites.
  • If a similar name is offered, confirm it is the field the value belongs to, not merely the closest spelling. A wrong-but-close field compiles and stores the value in the wrong place.
  • Do not expect update syntax to cover a bad name. It supplies fields you did not write; every field you did write is checked on its own.
  • After fixing an unknown name, compile again before assuming you are done. A missing field that was hidden behind the E0560 surfaces as E0063 on the next pass, and the tuple-struct and pattern shapes have their own follow-on errors.
  • Check the code before searching for help. The same bad name is E0560 in a struct literal, E0559 in a variant literal, E0026 in a pattern, and E0609 after a dot, and the four repairs are documented under four codes.

Sources

  • Rust Compiler Error Index, E0560 — for an unknown field being specified into a structure, for the erroneous example of a one-field struct constructed with an undeclared second name, and for the advice to verify the field's name was not misspelled or that the field exists.
  • The Rust Reference, Struct expressions — for a struct expression creating a struct, enum, or union value from a path followed by the values for the fields of the item, for a struct expression ending with .. and a base expression using the given values for the specified fields and moving or copying the remaining fields from the base, and for tuple structs being typically instantiated using a call expression rather than a struct expression with curly braces.

Keep Exploring