E0062type-check

Field specified more than once

A struct literal sets the same field twice.

Repro

struct User { id: u64, name: String }
let u = User { id: 1, name: "ada".into(), id: 2 };
// E0062: field `id` specified more than once

Why

Struct literal syntax names each field at most once. Duplicates are almost always a typo or a botched merge.

Fix

- Remove the duplicate. - After conflict resolution, eyeball the literal and lint via clippy/cargo check. - For builders, the same shape is impossible because each setter is a method call — yet another reason to prefer builder over raw literals for many-field structs.

Patterns that solve this