rust-lang / rust-lang/reference

Clarify wording of orphan rule to avoid ambiguity

Open
#1,998 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
1.6k
Forks
607
PR merge metrics
PR metrics pending

Description

https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules

"The orphan rule states that a trait implementation is only allowed if either the trait or at least one of the types in the implementation is defined in the current crate."

To me (non native English speaker, Rust learner) this sentence is ambiguous, in that "is defined" could be taken to mean both "is being defined" and "is already defined elsewhere than", which have opposite meanings.

I suggest this small change (in italics):
"The orphan rule states that a trait implementation is only allowed if either the trait or at least one of the types in the implementation is originally declared in the current crate."

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked Rust Reference orphan-rules section and review the quoted sentence in context. Done means the wording is revised to remove the ambiguity while preserving the rule's meaning.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
documentation
Issue type
Documentation
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.