External Publication
Visit Post

Yet another half-baked idea for working around the orphan rule

Rust Internals [Unofficial] March 31, 2026
Source

burakumin:

When foo is a child of bar, it inherits all inherent and trait implementations defined on Hello\bar. Mechanically, the compiler behaves as if identical implementations were generated for Hello\foo.

This breaks down when the trait implementation names the implementing type somewhere else.

For example imagine you create a facet foo for i32, then i32/foo inherits PartialEq<i32> and Eq. However PartialEq<i32/foo> is not implemented for i32/foo, hence the Eq implementation is an error. In this case the issue is that the PartialEq implementation uses the i32 type again in the trait generic parameters.

Discussion in the ATmosphere

Loading comments...