Use `diagnostic::on_unimplemented` to improve blanket impl debugging
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.
Actually, is it a problem to go ahead and start using this now? It's just an attribute, so older Rust versions should ignore it, right?
Unfortunately, no, it will result in "error[E0658]: #[diagnostic] attribute name space is experimental" compilation error or "error[E0433]: failed to resolve: use of undeclared type or module diagnostic" on older Rust versions.
With recent MSRV bumps / plans to bump MSRV, we can start considering this