Skip to content
Free public beta until December 4, 2026: every course is open, no card needed. After that, the first chapter of each course stays free and full access is a one-time $39 ($19 for up to 100 founding members chosen for helpful feedback). Your progress is kept. How the beta works

orphan rule

You may implement a trait for a type only if the trait or the type is yours.

The orphan rule (part of coherence) allows impl Trait for Type only when the trait or the type is defined in the current crate, so two crates can never supply conflicting impls.

Examples

  • impl fmt::Display for Vec<f64> fails with E0117, since both Display and Vec come from the standard library; a newtype wrapper gets around it.

Read the full section →