E0301: Duplicate interface requirement
| Code | Category | Stability |
|---|---|---|
E0301 | Semantic | Permanent |
Explanation
An interface declares more than one requirement with the same name. Requirement names are unique within an interface; different parameter lists do not introduce overloads.
Likely cause
A requirement was repeated or two operations were given the same name. Remove the duplicate or give distinct operations distinct names.
Examples
Repeated requirement
Requires --preview interfaces.
interface Show { fn show(borrow self); fn show(borrow self); }
fn main() {}
One requirement per name
Requires --preview interfaces.
interface Show { fn show(borrow self); }
fn main() {}