E0277: Unhelpful error message is given when indirect constraints cause blanket implementations to not get implemented #134346
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Code
Current output
Desired output
Rationale and extra context
Summary
When resolving Rust constraints that involve blanket implementations, Rust does not produce helpful error messages when missing indirect constraints caused the blanket implementation to not get implemented.
Rationale
The lack of informative error messages presents challenges in a new project that I am working on, context-generic programming, which implements a modular component system for Rust by making extensive use of blanket implementations. More details about how this error arised is described in the chapter of my book for debugging techniques.
For the purpose of this issue, I have attached a minimal code snippet with desugared code, so that it can be tested without importing my library
cgp
. For simplicity, the example code may look silly and does not demonstrate why it is written that way. The main purpose of the example code is to reproduce an example error message with as little code as possible.Other cases
Rust Version
Anything else?
The example code is also available on Rust Playground.
I already have a fix for this issue, and it is now available at #134348.
The text was updated successfully, but these errors were encountered: