Skip to content

Commit fb406a2

Browse files
authored
Fix example in orphan rule rationale
1 parent 59b8af8 commit fb406a2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/items/implementations.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ The *orphan rule* states that a trait implementation is only allowed if either t
178178

179179
An orphan implementation is one that implements a foreign trait for a foreign type. If these were freely allowed, two crates could implement the same trait for the same type in incompatible ways, creating a situation where adding or updating a dependency could break compilation due to conflicting implementations.
180180

181-
The orphan rule enables library authors to add new implementations to their traits without fear that they'll break downstream code. Without these restrictions, a library couldn't add an implementation like `impl<T: Display> MyTrait for T` without potentially conflicting with downstream implementations.
181+
The orphan rule enables library authors to add new implementations to their traits without fear that they'll break downstream code. Without these restrictions, a library couldn't add an implementation like `impl<T: Display> Trait for LocalGenericType<T>` without potentially conflicting with downstream implementations.
182182

183183
r[items.impl.trait.orphan-rule.general]
184184
Given `impl<P1..=Pn> Trait<T1..=Tn> for T0`, an `impl` is valid only if at

0 commit comments

Comments
 (0)