This repository was archived by the owner on May 28, 2025. It is now read-only.
Commit a1c98ca
authored
Rollup merge of rust-lang#132832 - compiler-errors:late-ty, r=cjgillot
Deny capturing late-bound ty/const params in nested opaques
First, this reverts a7f6095. I can't exactly remember why I approved this specific bit of rust-lang#132466; specifically, I don't know that the purpose of that commit is, and afaict we will never have an opaque that captures late-bound params through a const because opaques can't be used inside of anon consts. Am I missing something `@cjgillot?` Since I can't see a case where this matters, and no tests seem to fail.
The second commit adds a `deny_late_regions: bool` to distinguish `Scope::LateBoundary` which should deny *any* late-bound params or just ty/consts. Then, when resolving opaques we wrap ourselves in a `Scope::LateBoundary { deny_late_regions: false }` so that we deny late-bound ty/const, which fixes a bunch of ICEs that all vaguely look like `impl for<T> Trait<Assoc = impl OtherTrait<T>>`.
I guess this could be achieved other ways; for example, with a different scope kind, or maybe we could just reuse `Scope::Opaque`. But this seems a bit more verbose. I'm open to feedback anyways.
Fixes rust-lang#131535
Fixes rust-lang#131637
Fixes rust-lang#132530
I opted to remove those crashes tests ^ without adding them as regular tests, since they're basically triggering uninteresting late-bound ICEs far off in the trait solver, and the reason that existing tests such as `tests/ui/type-alias-impl-trait/non-lifetime-binder-in-constraint.rs` don't ICE are kinda just coincidental (i.e. due to a missing impl block). I don't really feel motivated to add random permutations to tests just to exercise non-lifetime binders.
r? cjgillotFile tree
8 files changed
+50
-47
lines changed- compiler/rustc_hir_analysis/src/collect
- tests
- crashes
- ui/type-alias-impl-trait
8 files changed
+50
-47
lines changedLines changed: 29 additions & 22 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
177 | 177 | | |
178 | 178 | | |
179 | 179 | | |
| 180 | + | |
180 | 181 | | |
181 | 182 | | |
182 | 183 | | |
| |||
234 | 235 | | |
235 | 236 | | |
236 | 237 | | |
237 | | - | |
238 | | - | |
239 | | - | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
240 | 243 | | |
241 | 244 | | |
242 | 245 | | |
| |||
573 | 576 | | |
574 | 577 | | |
575 | 578 | | |
576 | | - | |
577 | 579 | | |
578 | 580 | | |
579 | 581 | | |
580 | 582 | | |
581 | 583 | | |
582 | | - | |
583 | | - | |
584 | | - | |
585 | | - | |
586 | | - | |
587 | 584 | | |
588 | 585 | | |
589 | 586 | | |
| |||
624 | 621 | | |
625 | 622 | | |
626 | 623 | | |
627 | | - | |
628 | | - | |
629 | | - | |
630 | | - | |
631 | | - | |
632 | | - | |
| 624 | + | |
| 625 | + | |
633 | 626 | | |
634 | 627 | | |
635 | 628 | | |
| |||
640 | 633 | | |
641 | 634 | | |
642 | 635 | | |
643 | | - | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
644 | 646 | | |
645 | 647 | | |
646 | 648 | | |
| |||
997 | 999 | | |
998 | 1000 | | |
999 | 1001 | | |
1000 | | - | |
1001 | | - | |
1002 | | - | |
| 1002 | + | |
| 1003 | + | |
| 1004 | + | |
| 1005 | + | |
| 1006 | + | |
| 1007 | + | |
1003 | 1008 | | |
1004 | 1009 | | |
1005 | 1010 | | |
| |||
1291 | 1296 | | |
1292 | 1297 | | |
1293 | 1298 | | |
1294 | | - | |
1295 | | - | |
| 1299 | + | |
| 1300 | + | |
| 1301 | + | |
| 1302 | + | |
1296 | 1303 | | |
1297 | 1304 | | |
1298 | 1305 | | |
| |||
1508 | 1515 | | |
1509 | 1516 | | |
1510 | 1517 | | |
1511 | | - | |
| 1518 | + | |
1512 | 1519 | | |
1513 | 1520 | | |
1514 | 1521 | | |
| |||
This file was deleted.
This file was deleted.
This file was deleted.
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
Lines changed: 7 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
1 | 7 | | |
2 | 8 | | |
3 | 9 | | |
| |||
27 | 33 | | |
28 | 34 | | |
29 | 35 | | |
30 | | - | |
| 36 | + | |
31 | 37 | | |
32 | 38 | | |
33 | 39 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
Lines changed: 11 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
11 | 19 | | |
12 | 20 | | |
13 | 21 | | |
14 | | - | |
| 22 | + | |
15 | 23 | | |
16 | 24 | | |
17 | 25 | | |
18 | 26 | | |
19 | 27 | | |
20 | 28 | | |
21 | 29 | | |
22 | | - | |
| 30 | + | |
23 | 31 | | |
24 | 32 | | |
25 | 33 | | |
0 commit comments