Work tracking issue for moving rustc_infer
error reporting into rustc_trait_selection
#127492
Open
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_reporting
module (Move trait selection error reporting to its own top-level module #127493) - Move trait error reporting to
error_reporting::traits
(fromtraits::error_reporting
) (Move trait selection error reporting to its own top-level module #127493)- Split out overflow error reporting from other error reporting (More trait error reworking #127495)
- Split out ambiguity error reporting from other error reporting (More trait error reworking #127495)
- flatten module structure of
error_reporting::traits
(e.g. no need to havetype_err_ctxt_ext
module) (Get rid ofInferCtxtExt
fromerror_reporting::traits
#128076)
- Move rustc_infer's error reporting to
rustc_trait_selection::error_reporting::infer
(Uplift most type-system related error reporting fromrustc_infer
torustc_trait_selection
#128041)- Move all the diagnostics from infer -> trait selection ftl file (Uplift most type-system related error reporting from
rustc_infer
torustc_trait_selection
#128041) - Split out region error reporting from type error reporting (Consolidate region error reporting in
rustc_infer
#127500)
- Move all the diagnostics from infer -> trait selection ftl file (Uplift most type-system related error reporting from
- Pull
TypeErrCtxt
intorustc_trait_selection
, and delete all the extension traits (since they can be inherent now) (Uplift most type-system related error reporting fromrustc_infer
torustc_trait_selection
#128041)- Delete
can_eq_shallow
(Get rid ofcan_eq_shallow
#128067) - Delete normalization helper from
TypeErrCtxt
since normalization is defined inrustc_trait_selection
- Delete
- Audit code for anything that we can now use since error reporting lives in trait selection
Activity