Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Work tracking issue for moving rustc_infer error reporting into rustc_trait_selection #127492

Open
7 of 12 tasks
compiler-errors opened this issue Jul 8, 2024 · 0 comments
Open
7 of 12 tasks
Assignees
Labels
A-diagnostics Area: Messages for errors, warnings, and lints A-typesystem Area: The type system C-tracking-issue Category: A tracking issue for an RFC or an unstable feature. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-types Relevant to the types team, which will review and decide on the PR/issue.

Comments

@compiler-errors
Copy link
Member

compiler-errors commented Jul 8, 2024

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)

@compiler-errors compiler-errors self-assigned this Jul 8, 2024
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Jul 8, 2024
@Noratrieb Noratrieb added A-typesystem Area: The type system 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. C-tracking-issue Category: A tracking issue for an RFC or an unstable feature. T-types Relevant to the types team, which will review and decide on the PR/issue. and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Jul 8, 2024
bors added a commit to rust-lang-ci/rust that referenced this issue Jul 9, 2024
…r=lcnr

Move trait selection error reporting to its own top-level module

This effectively moves `rustc_trait_selection::traits::error_reporting` to `rustc_trait_selection::error_reporting::traits`. There are only a couple of actual changes to the code, like moving the `pretty_impl_header` fn out of the specialization module for privacy reasons.

This is quite pointless on its own, but having `error_reporting` as a top-level module in `rustc_trait_selection` is very important to make sure we have a meaningful file structure for when we move **type** error reporting (and region error reporting, with which it's incredibly entangled currently) into `rustc_trait_selection`. I've opened a tracking issue here: rust-lang#127492

r? lcnr
bors added a commit to rust-lang-ci/rust that referenced this issue Jul 9, 2024
…rrors, r=lcnr

Consolidate region error reporting in `rustc_infer`

More work on rust-lang#127492. Separate but important step, since I'm gonna likely pull everything else here into another module.

I don't think I'm confident whether `nice_region_error` should be a submodule of the new `rustc_infer::infer::error_reporting::region` module, so I left it alone for now.

r? lcnr
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Jul 9, 2024
…eworking, r=lcnr

More trait error reworking

More work on rust-lang#127492, specifically those sub-bullets under "Move trait error reporting to `error_reporting::traits`". Stacked on top of rust-lang#127493.

This does introduce new `TypeErrCtxt.*Ext` traits, but those will be deleted soon. Splitting this work into bite-sized pieces is the only way that it's gonna be feasible to both author and review ❤️

r? lcnr
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Jul 9, 2024
…eworking, r=lcnr

More trait error reworking

More work on rust-lang#127492, specifically those sub-bullets under "Move trait error reporting to `error_reporting::traits`". Stacked on top of rust-lang#127493.

This does introduce new `TypeErrCtxt.*Ext` traits, but those will be deleted soon. Splitting this work into bite-sized pieces is the only way that it's gonna be feasible to both author and review ❤️

r? lcnr
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Jul 9, 2024
…eworking, r=lcnr

More trait error reworking

More work on rust-lang#127492, specifically those sub-bullets under "Move trait error reporting to `error_reporting::traits`". Stacked on top of rust-lang#127493.

This does introduce new `TypeErrCtxt.*Ext` traits, but those will be deleted soon. Splitting this work into bite-sized pieces is the only way that it's gonna be feasible to both author and review ❤️

r? lcnr
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Jul 9, 2024
…eworking, r=lcnr

More trait error reworking

More work on rust-lang#127492, specifically those sub-bullets under "Move trait error reporting to `error_reporting::traits`". Stacked on top of rust-lang#127493.

This does introduce new `TypeErrCtxt.*Ext` traits, but those will be deleted soon. Splitting this work into bite-sized pieces is the only way that it's gonna be feasible to both author and review ❤️

r? lcnr
bors added a commit to rust-lang-ci/rust that referenced this issue Jul 10, 2024
…orking, r=lcnr

More trait error reworking

More work on rust-lang#127492, specifically those sub-bullets under "Move trait error reporting to `error_reporting::traits`". Stacked on top of rust-lang#127493.

This does introduce new `TypeErrCtxt.*Ext` traits, but those will be deleted soon. Splitting this work into bite-sized pieces is the only way that it's gonna be feasible to both author and review ❤️

r? lcnr
bors added a commit to rust-lang-ci/rust that referenced this issue Jul 22, 2024
…rait-sel, r=lcnr

Uplift most type-system related error reporting from `rustc_infer` to `rustc_trait_selection`

Completes the major part of rust-lang#127492. The only cleanup that's needed afterwards is to actually use normalization in favor of the callback where needed, and deleting `can_eq_shallow`.

r? lcnr

Sorry for the large diff! Would prefer if comments can be handled in a follow-up (unless they're absolutely dealbreakers) because it seems bitrotty to let this sit.
bors added a commit to rust-lang-ci/rust that referenced this issue Jul 22, 2024
…rait-sel, r=lcnr

Uplift most type-system related error reporting from `rustc_infer` to `rustc_trait_selection`

Completes the major part of rust-lang#127492. The only cleanup that's needed afterwards is to actually use normalization in favor of the callback where needed, and deleting `can_eq_shallow`.

r? lcnr

Sorry for the large diff! Would prefer if comments can be handled in a follow-up (unless they're absolutely dealbreakers) because it seems bitrotty to let this sit.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints A-typesystem Area: The type system C-tracking-issue Category: A tracking issue for an RFC or an unstable feature. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-types Relevant to the types team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

3 participants