Commit 4e68d06
authored
Rollup merge of rust-lang#130412 - compiler-errors:rpitit-overcapture, r=jieyouxu
Don't ICE when RPITIT captures more method args than trait definition
Make sure we don't ICE when an RPITIT captures more method args than the trait definition, which is not allowed. This was because we were using the wrong def id for error reporting.
Due to the default lifetime capture rules of RPITITs (capturing everything in scope), this is only doable if we use precise capturing, which isn't currently allowed for RPITITs anyways but we still end up reaching the relevant codepaths.
Fixes rust-lang#129850File tree
5 files changed
+73
-17
lines changed- compiler
- rustc_hir_analysis/src/check
- rustc_middle/src/ty
- tests
- crashes
- ui/impl-trait/precise-capturing
5 files changed
+73
-17
lines changedLines changed: 10 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
726 | 726 | | |
727 | 727 | | |
728 | 728 | | |
729 | | - | |
| 729 | + | |
730 | 730 | | |
731 | 731 | | |
732 | 732 | | |
| |||
844 | 844 | | |
845 | 845 | | |
846 | 846 | | |
| 847 | + | |
| 848 | + | |
847 | 849 | | |
848 | 850 | | |
849 | 851 | | |
| 852 | + | |
850 | 853 | | |
851 | | - | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
852 | 857 | | |
| 858 | + | |
853 | 859 | | |
854 | 860 | | |
855 | 861 | | |
| |||
885 | 891 | | |
886 | 892 | | |
887 | 893 | | |
888 | | - | |
889 | | - | |
| 894 | + | |
890 | 895 | | |
891 | 896 | | |
892 | 897 | | |
| |||
899 | 904 | | |
900 | 905 | | |
901 | 906 | | |
902 | | - | |
| 907 | + | |
903 | 908 | | |
904 | 909 | | |
905 | 910 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
255 | 255 | | |
256 | 256 | | |
257 | 257 | | |
258 | | - | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
259 | 261 | | |
260 | 262 | | |
261 | 263 | | |
| |||
264 | 266 | | |
265 | 267 | | |
266 | 268 | | |
267 | | - | |
| 269 | + | |
268 | 270 | | |
269 | 271 | | |
270 | 272 | | |
| |||
273 | 275 | | |
274 | 276 | | |
275 | 277 | | |
276 | | - | |
| 278 | + | |
277 | 279 | | |
278 | 280 | | |
279 | 281 | | |
| |||
This file was deleted.
Lines changed: 16 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
Lines changed: 42 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
0 commit comments