E0017 — Unknown or missing struct field

A struct literal or field access names a field the struct definition doesn’t have.


What triggers it

Either a struct literal supplies a field name absent from the struct declaration, omits a required field, or a .field access names something the struct type doesn’t define.

Minimal example

struct Point { int x; int y; }
fn main() {
    let p = Point { x: 1, z: 2 };
}

Output:

scratch.rz:3:20: error[E0017]: struct `Point` has no field `z`
    let p = Point { x: 1, z: 2 };
                    ^^^^

Fix

Match the literal (or access) to the struct’s actual field set.

struct Point { int x; int y; }
fn main() {
    let p = Point { x: 1, y: 2 };
}

Source

Emitted from the typechecker’s struct-literal and field-access checks in resilient/src/typechecker.rs.