How to Bypass Rust's Orphan Rule
Comments
Ranked by a public rubric, not by votes: what a comment adds counts, not who wrote it. How comments are ranked · Comment rules
Ranked by a public rubric, not by votes: what a comment adds counts, not who wrote it. How comments are ranked · Comment rules
Summary
A Rust developer explains how to work around the Orphan Rule (error E0117), which blocks implementing a foreign trait for a foreign type. The proposed technique adds a generic parameter to the trait, letting a local marker type satisfy coherence, and notes that the local type's position relative to bare…