Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardRustTrait coherence and orphan ruleSingle-choice MCQ

Why does the compiler reject the second impl with conflicting-implementation error E0119 rather than an orphan-rule error, even though both impls are in the same crate?

trait Greet { fn hi(&self) -> &'static str; } impl<T> Greet for T { fn hi(&self) -> &'static str { "blanket" } } struct S; impl Greet for S { fn hi(&self) -> &'static str { "specific" } }