Skip to content
ZOLO / TE845 Type · error

From/TryFrom implementation violates conversion coherence

An `impl From<S>`/`TryFrom<S>` is only legal in the package that owns the source `S` or the destination type — otherwise two unrelated packages could define competing meanings for the same conversion. Zolo also rejects overlapping implementations and never searches conversion chains such as `A -> B -> C`.

An implementation of From<S> or TryFrom<S> is only legal in the package that owns the source S or the destination type. This prevents two unrelated packages from defining competing meanings for the same conversion.

// Invalid when both ExternalId and OtherExternalId come from dependencies.
impl From<ExternalId> for OtherExternalId { ... }

Define a local newtype/struct around one side, or move the implementation to the package that declares one of the two types. Zolo also rejects overlapping implementations and never searches conversion chains such as A -> B -> C.

Global index

Find your way through Zolo

Try an idea

Start here

9 results

9 results

enespt-br