`rustc_on_unimplemented` should work on specific trait methods
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 119k
- Forks
- 16.1k
- PR merge metrics
- PR metrics pending
Description
Code
`var_with_complicated_type >= another_var_with_complicated_type`
Current output
implementation for `ComplicatedType < ComplicatedType` and `ComplicatedType > ComplicatedType`
Desired output
implementation for `ComplicatedType >= ComplicatedType`
Rationale and extra context
rustc_on_unimplemented should be applicable to specific trait methods, in addition to the trait as a whole. Then, if the error involves calling a specific trait method, the compiler can give a more specific error message.
In the specific case of PartialOrd, this would also avoid repeating both type names twice.
Other cases
Rust Version
git commit 7349f6b50359fd1f11738765b8deec5ee02d8710
Anything else?
No response
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 by tracing how the rustc_on_unimplemented attribute is applied to traits and how PartialOrd diagnostics are produced. Determine where method-specific handling would fit, then verify that comparisons such as >= produce only the relevant ComplicatedType >= ComplicatedType message while existing trait-level behavior remains intact.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100