Harmonize using root or leaf obligation in trait error reporting#126142
Merged
bors merged 5 commits intorust-lang:masterfrom Jun 13, 2024
Merged
Harmonize using root or leaf obligation in trait error reporting#126142bors merged 5 commits intorust-lang:masterfrom
bors merged 5 commits intorust-lang:masterfrom
Conversation
This comment has been minimized.
This comment has been minimized.
Member
|
r=me with tests blessed |
d2fa92b to
c90b1fc
Compare
compiler-errors
commented
Jun 12, 2024
| | | ||
| LL | type Bar<T>: Baz<Self> = i32; | ||
| | ^^^ the trait `Eq<i32>` is not implemented for `i32`, which is required by `i32: Baz<Self>` | ||
| | ^^^ the trait `Eq<i32>` is not implemented for `<Self as Foo>::Bar<()>`, which is required by `i32: Baz<Self>` |
Contributor
Author
There was a problem hiding this comment.
The only appreciable difference here is that we actually report the right self type here now.
| --> $DIR/assume-gat-normalization-for-nested-goals.rs:9:30 | ||
| | | ||
| LL | type Bar<T>: Baz<Self> = i32; | ||
| | ^^^ the trait `Eq<i32>` is not implemented for `i32`, which is required by `i32: Baz<Self>` |
Contributor
Author
There was a problem hiding this comment.
This message was also previously just not correct -- Eq<i32> is implemented by i32 lol
Contributor
Author
|
@bors r=jackh726 |
Collaborator
compiler-errors
added a commit
to compiler-errors/rust
that referenced
this pull request
Jun 13, 2024
…=jackh726 Harmonize using root or leaf obligation in trait error reporting When rust-lang#121826 changed the error reporting to use root obligation and not the leafmost obligation, it didn't actually make sure that all the other diagnostics helper functions used the right obligation. Specifically, when reporting similar impl candidates we are looking for impls of the root obligation, but trying to match them against the trait ref of the leaf obligation. This does a few other miscellaneous changes. There's a lot more clean-up that could be done here, but working with this code is really grief-inducing due to how messy it has become over the years. Someone really needs to show it love. 😓 r? `@estebank` Fixes rust-lang#126129
Member
|
sorry, seems to need a rebase! |
Member
|
"conflicts" with https://github.com/rust-lang/rust/pull/126187/files#diff-63c8c70fb480c0c10ffa9ba981d76373b6d6b48327cdd7c317b0d75148904dc6 which adds a use of @bors r- |
This comment has been minimized.
This comment has been minimized.
c90b1fc to
ae24ebe
Compare
Member
|
@bors r=jackh726 |
Collaborator
workingjubilee
added a commit
to workingjubilee/rustc
that referenced
this pull request
Jun 13, 2024
…=jackh726 Harmonize using root or leaf obligation in trait error reporting When rust-lang#121826 changed the error reporting to use root obligation and not the leafmost obligation, it didn't actually make sure that all the other diagnostics helper functions used the right obligation. Specifically, when reporting similar impl candidates we are looking for impls of the root obligation, but trying to match them against the trait ref of the leaf obligation. This does a few other miscellaneous changes. There's a lot more clean-up that could be done here, but working with this code is really grief-inducing due to how messy it has become over the years. Someone really needs to show it love. 😓 r? `@estebank` Fixes rust-lang#126129
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Jun 13, 2024
…kingjubilee Rollup of 11 pull requests Successful merges: - rust-lang#125165 (Migrate `run-make/pgo-branch-weights` to `rmake`) - rust-lang#125674 (Rewrite `symlinked-extern`, `symlinked-rlib` and `symlinked-libraries` `run-make` tests in `rmake.rs` format) - rust-lang#125688 (Walk into alias-eq nested goals even if normalization fails) - rust-lang#126142 (Harmonize using root or leaf obligation in trait error reporting) - rust-lang#126303 (Urls to docs in rust_hir) - rust-lang#126328 (Add Option::is_none_or) - rust-lang#126337 (Add test for walking order dependent opaque type behaviour) - rust-lang#126351 (std::unix::fs::link using direct linkat call for Solaris.) - rust-lang#126353 (Move `MatchAgainstFreshVars` to old solver) - rust-lang#126356 (docs(rustc): Improve discoverable of Cargo docs) - rust-lang#126362 (Make `try_from_target_usize` method public) r? `@ghost` `@rustbot` modify labels: rollup
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Jun 13, 2024
…kingjubilee Rollup of 10 pull requests Successful merges: - rust-lang#125674 (Rewrite `symlinked-extern`, `symlinked-rlib` and `symlinked-libraries` `run-make` tests in `rmake.rs` format) - rust-lang#125688 (Walk into alias-eq nested goals even if normalization fails) - rust-lang#126142 (Harmonize using root or leaf obligation in trait error reporting) - rust-lang#126303 (Urls to docs in rust_hir) - rust-lang#126328 (Add Option::is_none_or) - rust-lang#126337 (Add test for walking order dependent opaque type behaviour) - rust-lang#126353 (Move `MatchAgainstFreshVars` to old solver) - rust-lang#126356 (docs(rustc): Improve discoverable of Cargo docs) - rust-lang#126358 (safe transmute: support `Single` enums) - rust-lang#126362 (Make `try_from_target_usize` method public) r? `@ghost` `@rustbot` modify labels: rollup
rust-timer
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Jun 13, 2024
Rollup merge of rust-lang#126142 - compiler-errors:trait-ref-split, r=jackh726 Harmonize using root or leaf obligation in trait error reporting When rust-lang#121826 changed the error reporting to use root obligation and not the leafmost obligation, it didn't actually make sure that all the other diagnostics helper functions used the right obligation. Specifically, when reporting similar impl candidates we are looking for impls of the root obligation, but trying to match them against the trait ref of the leaf obligation. This does a few other miscellaneous changes. There's a lot more clean-up that could be done here, but working with this code is really grief-inducing due to how messy it has become over the years. Someone really needs to show it love. 😓 r? ``@estebank`` Fixes rust-lang#126129
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When #121826 changed the error reporting to use root obligation and not the leafmost obligation, it didn't actually make sure that all the other diagnostics helper functions used the right obligation.
Specifically, when reporting similar impl candidates we are looking for impls of the root obligation, but trying to match them against the trait ref of the leaf obligation.
This does a few other miscellaneous changes. There's a lot more clean-up that could be done here, but working with this code is really grief-inducing due to how messy it has become over the years. Someone really needs to show it love. 😓
r? @estebank
Fixes #126129