Skip to content

rustc_on_unimplemented should work on specific trait methods #135117

Open
@joshtriplett

Description

@joshtriplett

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lintsC-enhancementCategory: An issue proposing an enhancement or a PR with one.D-diagnostic-infraDiagnostics: Issues that affect all diagnostics, or relate to the diagnostic machinery itself.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions