Commit d4d7cc3
authored
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#126129File tree
23 files changed
+153
-110
lines changed- compiler
- rustc_infer/src
- infer/error_reporting
- traits
- rustc_middle/src
- traits
- ty
- rustc_trait_selection/src/traits
- error_reporting
- select
- tests/ui
- auto-traits
- generic-associated-types
- kindck
- suggestions
- traits
- next-solver
- diagnostics
- suggest-dereferences
- transmutability/references
- typeck
23 files changed
+153
-110
lines changedLines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
546 | 546 | | |
547 | 547 | | |
548 | 548 | | |
549 | | - | |
| 549 | + | |
550 | 550 | | |
551 | 551 | | |
552 | 552 | | |
| |||
715 | 715 | | |
716 | 716 | | |
717 | 717 | | |
718 | | - | |
| 718 | + | |
719 | 719 | | |
720 | 720 | | |
721 | 721 | | |
| |||
869 | 869 | | |
870 | 870 | | |
871 | 871 | | |
872 | | - | |
| 872 | + | |
873 | 873 | | |
874 | 874 | | |
875 | 875 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
285 | 285 | | |
286 | 286 | | |
287 | 287 | | |
288 | | - | |
289 | | - | |
| 288 | + | |
290 | 289 | | |
291 | 290 | | |
292 | 291 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | | - | |
| 40 | + | |
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
313 | 313 | | |
314 | 314 | | |
315 | 315 | | |
316 | | - | |
| 316 | + | |
317 | 317 | | |
318 | 318 | | |
319 | 319 | | |
| |||
Lines changed: 4 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3597 | 3597 | | |
3598 | 3598 | | |
3599 | 3599 | | |
3600 | | - | |
| 3600 | + | |
3601 | 3601 | | |
3602 | 3602 | | |
3603 | 3603 | | |
| |||
4863 | 4863 | | |
4864 | 4864 | | |
4865 | 4865 | | |
4866 | | - | |
4867 | | - | |
| 4866 | + | |
4868 | 4867 | | |
4869 | 4868 | | |
4870 | 4869 | | |
4871 | 4870 | | |
4872 | 4871 | | |
4873 | | - | |
| 4872 | + | |
4874 | 4873 | | |
4875 | 4874 | | |
4876 | 4875 | | |
| |||
4895 | 4894 | | |
4896 | 4895 | | |
4897 | 4896 | | |
4898 | | - | |
| 4897 | + | |
4899 | 4898 | | |
4900 | 4899 | | |
4901 | 4900 | | |
| |||
Lines changed: 76 additions & 77 deletions
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
194 | 194 | | |
195 | 195 | | |
196 | 196 | | |
197 | | - | |
| 197 | + | |
198 | 198 | | |
199 | 199 | | |
200 | 200 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1866 | 1866 | | |
1867 | 1867 | | |
1868 | 1868 | | |
1869 | | - | |
| 1869 | + | |
1870 | 1870 | | |
1871 | 1871 | | |
1872 | 1872 | | |
| |||
1909 | 1909 | | |
1910 | 1910 | | |
1911 | 1911 | | |
1912 | | - | |
| 1912 | + | |
1913 | 1913 | | |
1914 | 1914 | | |
1915 | 1915 | | |
| |||
1934 | 1934 | | |
1935 | 1935 | | |
1936 | 1936 | | |
1937 | | - | |
| 1937 | + | |
1938 | 1938 | | |
1939 | | - | |
| 1939 | + | |
1940 | 1940 | | |
1941 | 1941 | | |
1942 | | - | |
| 1942 | + | |
1943 | 1943 | | |
1944 | 1944 | | |
1945 | 1945 | | |
| |||
1957 | 1957 | | |
1958 | 1958 | | |
1959 | 1959 | | |
1960 | | - | |
| 1960 | + | |
1961 | 1961 | | |
1962 | 1962 | | |
1963 | 1963 | | |
1964 | 1964 | | |
1965 | | - | |
| 1965 | + | |
1966 | 1966 | | |
1967 | 1967 | | |
1968 | 1968 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
132 | 132 | | |
133 | 133 | | |
134 | 134 | | |
135 | | - | |
| 135 | + | |
136 | 136 | | |
137 | 137 | | |
138 | 138 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
125 | 125 | | |
126 | 126 | | |
127 | 127 | | |
128 | | - | |
| 128 | + | |
129 | 129 | | |
130 | 130 | | |
131 | 131 | | |
| |||
0 commit comments