Two impls match the same type — coherence rule violated.
trait Speak { fn speak(&self) -> &'static str; }
impl<T> Speak for T { fn speak(&self) -> &'static str { "any" } }
impl Speak for String { fn speak(&self) -> &'static str { "string" } }
// E0119: conflicting impls for `Speak` for type `String`
Rust requires coherence: at most one impl can apply to any concrete type. A blanket impl over T already covers String; the specific impl for String would conflict.
- Drop one impl. Decide which behaviour you actually want.
- Constrain the blanket with a marker trait: impl<T: MyMarker> Speak for T. Implementers opt in via MyMarker.
- Wrap the type in a newtype so the impl applies to the wrapper, not the original.
- For overlapping impls in std-style code, the unstable specialization feature provides priority — but it's not yet stable.