Commit 0b71ffc
committed
Auto merge of #100654 - compiler-errors:rework-point-at-arg, r=estebank
Rework "point at arg" suggestions to be more accurate
Fixes #100560
Introduce a new set of `ObligationCauseCode`s which have additional bookeeping for what expression caused the obligation, and which predicate caused the obligation. This allows us to look at the _unsubstituted_ signature to find out which parameter or generic type argument caused an obligaton to fail.
This means that (in most cases) we significantly improve the likelihood of pointing out the right argument that causes a fulfillment error. Also, since this logic isn't happening in just the `select_where_possible_and_mutate_fulfillment()` calls in the argument checking code, but instead during all trait selection in `FnCtxt`, we are also able to point out the correct argument even if inference means that we don't know whether an obligation has failed until well after a call expression has been checked.
r? `@ghost`File tree
161 files changed
+1369
-780
lines changed- compiler
- rustc_infer/src/infer
- error_reporting
- nice_region_error
- outlives
- rustc_middle/src
- traits
- ty
- rustc_span/src
- rustc_trait_selection/src/traits
- error_reporting
- rustc_typeck/src/check
- fn_ctxt
- method
- src/test/ui
- associated-types
- async-await
- issues
- auto-traits
- chalkify
- closure_context
- closures
- 2229_closure_analysis/diagnostics
- const-generics
- defaults
- generic_const_exprs
- consts
- derives
- did_you_mean
- error-codes
- extern
- feature-gates
- fmt
- generator
- print
- generic-associated-types/bugs
- higher-rank-trait-bounds/normalize-under-binder
- inference
- interior-mutability
- issues
- iterators
- kindck
- lazy-type-alias-impl-trait
- mismatched_types
- never_type
- not-panic
- on-unimplemented
- parser/issues
- pattern/move-ref-patterns
- proc-macro
- range
- rfc-2632-const-trait-impl
- suggestions
- traits
- associated_type_bound
- bound
- inheritance
- negative-impls
- transmutability
- typeck
- type
- ufcs
- unboxed-closures
- union
- unsized-locals
- unsized
- where-clauses
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
161 files changed
+1369
-780
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
740 | 740 | | |
741 | 741 | | |
742 | 742 | | |
743 | | - | |
744 | | - | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
745 | 747 | | |
746 | | - | |
747 | | - | |
748 | | - | |
| 748 | + | |
749 | 749 | | |
750 | 750 | | |
751 | 751 | | |
| |||
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
| 38 | + | |
| 39 | + | |
39 | 40 | | |
40 | 41 | | |
41 | 42 | | |
| |||
Lines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
211 | 211 | | |
212 | 212 | | |
213 | 213 | | |
214 | | - | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
215 | 218 | | |
216 | 219 | | |
217 | 220 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
232 | 232 | | |
233 | 233 | | |
234 | 234 | | |
235 | | - | |
| 235 | + | |
236 | 236 | | |
237 | 237 | | |
238 | 238 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
390 | 390 | | |
391 | 391 | | |
392 | 392 | | |
| 393 | + | |
393 | 394 | | |
394 | 395 | | |
395 | 396 | | |
396 | | - | |
| 397 | + | |
| 398 | + | |
397 | 399 | | |
398 | 400 | | |
399 | 401 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
100 | | - | |
| 100 | + | |
| 101 | + | |
101 | 102 | | |
102 | 103 | | |
103 | 104 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
234 | 234 | | |
235 | 235 | | |
236 | 236 | | |
237 | | - | |
238 | | - | |
| 237 | + | |
| 238 | + | |
239 | 239 | | |
240 | 240 | | |
241 | | - | |
| 241 | + | |
| 242 | + | |
242 | 243 | | |
243 | 244 | | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
244 | 254 | | |
245 | 255 | | |
246 | 256 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
122 | 122 | | |
123 | 123 | | |
124 | 124 | | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
125 | 140 | | |
126 | 141 | | |
127 | 142 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
664 | 664 | | |
665 | 665 | | |
666 | 666 | | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
667 | 677 | | |
668 | 678 | | |
669 | 679 | | |
| |||
Lines changed: 11 additions & 17 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
860 | 860 | | |
861 | 861 | | |
862 | 862 | | |
863 | | - | |
864 | | - | |
| 863 | + | |
865 | 864 | | |
866 | 865 | | |
867 | 866 | | |
| |||
1564 | 1563 | | |
1565 | 1564 | | |
1566 | 1565 | | |
| 1566 | + | |
| 1567 | + | |
1567 | 1568 | | |
1568 | 1569 | | |
1569 | 1570 | | |
| |||
2091 | 2092 | | |
2092 | 2093 | | |
2093 | 2094 | | |
2094 | | - | |
| 2095 | + | |
2095 | 2096 | | |
2096 | | - | |
2097 | | - | |
2098 | | - | |
2099 | | - | |
2100 | | - | |
| 2097 | + | |
| 2098 | + | |
| 2099 | + | |
2101 | 2100 | | |
2102 | 2101 | | |
2103 | 2102 | | |
| |||
2520 | 2519 | | |
2521 | 2520 | | |
2522 | 2521 | | |
2523 | | - | |
2524 | | - | |
2525 | | - | |
2526 | | - | |
2527 | | - | |
2528 | | - | |
2529 | | - | |
2530 | | - | |
2531 | | - | |
| 2522 | + | |
| 2523 | + | |
| 2524 | + | |
| 2525 | + | |
2532 | 2526 | | |
2533 | 2527 | | |
2534 | 2528 | | |
| |||
0 commit comments