Skip to main content

E0014: Duplicate Struct Field

A struct definition contains the same field name more than once.

Example

struct Point {
x: i64,
y: i64,
x: i64, // Error: field `x` appears multiple times in struct `Point`
}

How to fix

Remove the duplicate field or give it a unique name:

struct Point {
x: i64,
y: i64,
z: i64, // OK
}