Skip to content

Use diagnostic::on_unimplemented to improve blanket impl debugging #1563

@tarcieri

Description

@tarcieri

Rust 1.78 added a new diagnostic::on_unimplemented attribute which can be used to add additional context in the event a trait isn't impl'd in the form of note messages that appear in the diagnostics:

https://rust-lang.github.io/rfcs/3368-diagnostic-attribute-namespace.html#guide-level-explanation

These seem very helpful for improving debugging of missing trait impls which are expected to be received via a blanket impl, i.e. the note can include the name of the other trait the user is expected to implement.

It will be awhile before we can consider Rust 1.78, however I thought I'd go ahead and open this as a tracking / planning issue for using this feature.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions