3 ms·
Rust's trait coherence rules can make it impossible to split certain crates up. On the flip-side, cargo's workspace features make multi-crate projects easier to
by Georgelemental 3y ago
Rust's trait coherence rules can make it impossible to split certain crates up. On the flip-side, cargo's workspace features make multi-crate projects easier to manage. I would love it if it were possible to loosen coherence within a workspace.
- duped 3y ago"private" trait impls (1) would be a much better solution. You probably never want the impl of a trait for a foreign type to be exposed to other crates, it's so unlikely that forbidding it in the name of coherence would probably work out. But there's apparently many gotchas and no one has clearly written a way around them (2). (1) https://github.com/rust-lang/rfcs/issues/493 https://github.com/rust-lang/rfcs/issues/493 (although the comment section is kind of unhinged and goes off on distant tangents to modular typeclasses and first class modules) (2) http://smallcultfollowing.com/babysteps/blog/2015/01/14/little-orphan-impls/ http://smallcultfollowing.com/babysteps/blog/2015/01/14/litt...