Why this fires¶
An implementation is not coherent with its trait declaration. Either it adds a method the trait does not declare, or another implementation can satisfy the same parameterized target and trait instance.
trait Convert<T> { fn convert(self, value: T) -> T }
struct Converter {}
impl Convert<int> for Converter {
fn convert(self, value: int) -> int { value }
}
impl Convert<int> for Converter {
// ^^^^^^^^^^^^ error[TE303]: overlapping impl
fn convert(self, value: int) -> int { value }
}Fix it¶
Keep exactly one witness for each target pattern and exact trait instance. Different instances such as Convert<int> and Convert<str> may coexist when their arguments cannot overlap. Remove methods that are not part of the trait, or move them to an inherent impl Type block.