E0405: Duplicate type definition
| Code | Category | Stability |
|---|---|---|
E0405 | Struct and enum | Permanent |
Explanation
A module defines more than one struct or enum with the same type name.
Likely cause
A type declaration was duplicated, or a struct and enum in the same module were given the same name. Rename or remove one declaration; separate modules may independently use the same type name.
Examples
Duplicate type name
struct Point { x: i32 }
enum Point { Origin }
fn main() -> i32 { 0 }
Use unique type names in one module
struct Point { x: i32 }
enum Position { Origin }
fn main() -> i32 {
Point { x: 42 }.x
}