Work tracking issue for moving `rustc_infer` error reporting into `rustc_trait_selection`
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 119k
- Forks
- 16.1k
- PR merge metrics
- PR metrics pending
Description
I'm mostly just opening this for myself since I want somewhere to track the work. Look away unless you care about completely compiler-internal stuff.
The motivation for doing this is that error reporting in rustc_infer is fraught with challenges, like the lack of trait selection. This became evident in #127172, which demonstrates that the new trait solver needs trait selection in order to actually even prove that things can be equal or not. We also suffer from the lack of normalization, and to a lesser extent autoderef (though the latter isn't yet uplifted into trait selection, it very well could be, or at least replicated in some way for the purposes of diagnostics, but that requires trait selection lol)
- Create top level
rustc_trait_selection::error_reportingmodule (#127493) - Move trait error reporting to
error_reporting::traits(fromtraits::error_reporting) (#127493)- Split out overflow error reporting from other error reporting (#127495)
- Split out ambiguity error reporting from other error reporting (#127495)
- flatten module structure of
error_reporting::traits(e.g. no need to havetype_err_ctxt_extmodule) (#128076)
- Move rustc_infer's error reporting to
rustc_trait_selection::error_reporting::infer(#128041)- Move all the diagnostics from infer -> trait selection ftl file (#128041)
- Split out region error reporting from type error reporting (#127500)
- Pull
TypeErrCtxtintorustc_trait_selection, and delete all the extension traits (since they can be inherent now) (#128041)- Delete
can_eq_shallow(#128067) - Delete normalization helper from
TypeErrCtxtsince normalization is defined inrustc_trait_selection(#157715)
- Delete
- Audit code for anything that we can now use since error reporting lives in trait selection
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the remaining unchecked audit item and the completed migration history in rustc_trait_selection::error_reporting and rustc_infer. Identify compiler code that can now use functionality exposed by the move, then verify each candidate with the relevant compiler tests; done means the audit is complete and any resulting follow-up work is clearly recorded.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- compilers
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100