rust-lang / rust-lang/reference
How method resolution ambiguties are/aren't resolved
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:
- https://github.com/rust-lang/rust/blob/master/src/test/ui/derives/derive-Debug-use-ufcs-struct.rs
- https://github.com/rust-lang/rust/blob/master/src/test/ui/derives/derive-Debug-use-ufcs-tuple.rs
But we still need better docs in the reference
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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