rust-lang / rust-lang/reference

How method resolution ambiguties are/aren't resolved

Open
#1,308 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

Spawned off of https://github.com/rust-lang/rust/issues/81211#issuecomment-767111563

We need better documentation of the method resolution rules, in terms of how ambiguities are resolved (to either a single method or to a method ambiguity error).

I wrote tests in PR #81294 that tried to enumerate the relevant combinations; see:

But we still need better docs in the reference

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 method-resolution discussion in issue #81211 and the test cases in src/test/ui/derives/derive-Debug-use-ufcs-struct.rs and derive-Debug-use-ufcs-tuple.rs. Review the existing Rust Reference sections on method resolution, then document how the relevant ambiguities resolve or produce an ambiguity error. Done means the reference explains the combinations covered by the tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
documentation
Issue type
Documentation
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.