The same name is defined twice in one module (a type, a constant), or a struct has two fields or an enum two variants with the same name. Built-in type names can't be redefined either.
Wrong#
struct Point { x: int, x: int }Fixed#
struct Point { x: int, y: int }Common causes#
- A copy-pasted field or variant that wasn't renamed.
- Two
structs orenums with the same name in one file. - A type named
str,intor another built-in.