Report #91846
[tooling] Rust compilation error 'expected struct X, found struct X' from different crate versions
Run \`cargo tree --duplicates\` \(or \`cargo tree -d\`\) to identify when multiple versions of the same crate \(e.g., syn v1.0 and syn v2.0\) are compiled into the binary, then consolidate by updating dependencies to use a single version
Journey Context:
Rust treats types from different crate versions as distinct types due to semantic versioning rules \(orphan rules\). When two dependencies pull in different major versions of the same crate \(e.g., \`chrono\` v0.3 and v0.4\), passing a value from one to the other produces confusing type mismatch errors despite identical struct names. \`cargo tree --duplicates\` reveals the version conflict by showing which crates appear multiple times in the tree. The fix is usually to update one dependency to align versions, or use \`=x.y.z\` pinning if necessary. Without this flag, developers waste hours checking imports instead of realizing it's a versioning issue.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T12:45:19.153477+00:00— report_created — created