RustCrypto / RustCrypto/traits

Use `diagnostic::on_unimplemented` to improve blanket impl debugging

Open
#1,563 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
755
Forks
256
Avg merge
1h 27m
Merged PRs (30d)
2

Description

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.

Contributor guide

No contributing guide indexed for this repository

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

No files or tests are named. Start by reading the linked Rust RFC and searching the repository for blanket implementations whose missing-trait diagnostics could explain the expected trait. Done should be a scoped decision about where to apply on_unimplemented and what diagnostic notes each case should provide.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.