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)
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_inferis 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)rustc_trait_selection::error_reportingmodule (Move trait selection error reporting to its own top-level module #127493)error_reporting::traits(fromtraits::error_reporting) (Move trait selection error reporting to its own top-level module #127493)error_reporting::traits(e.g. no need to havetype_err_ctxt_extmodule) (Get rid ofInferCtxtExtfromerror_reporting::traits#128076)rustc_trait_selection::error_reporting::infer(Uplift most type-system related error reporting fromrustc_infertorustc_trait_selection#128041)rustc_infertorustc_trait_selection#128041)rustc_infer#127500)TypeErrCtxtintorustc_trait_selection, and delete all the extension traits (since they can be inherent now) (Uplift most type-system related error reporting fromrustc_infertorustc_trait_selection#128041)can_eq_shallow(Get rid ofcan_eq_shallow#128067)TypeErrCtxtsince normalization is defined inrustc_trait_selection(Stop using a fn pointer to normalize_fn_sig inside TypeErrCtxt #157715)