This repository was archived by the owner on May 28, 2025. It is now read-only.
Commit 56d23c2
committed
Auto merge of rust-lang#126024 - oli-obk:candidate_key_caching_is_unsound_yay, r=<try>
Do not use global cache for selection candidates if opaque types can be constrained
fixes rust-lang#105787
r? `@ghost`
This is certainly the crudest way to make the cache sound wrt opaque types, but if perf lets us get away with this, let's do it in the old solver and let the new solver fix this correctly once and for all.
If perf is prohibitively bad, I'll look into alternatives (using canonical queries, checking whether any opaque types got constrained or whether decisions based on the availability of opaque types were made, still using the cache for things that can't possibly constrain opaque types (probably sound, famous last words), ..)
cc rust-lang#122192 (comment)
* [ ] check if this actually fixes rust-lang#105787 or if it just fixes the opaque type reproducerFile tree
7 files changed
+56
-12
lines changed- compiler
- rustc_middle/src/traits
- rustc_trait_selection/src/traits/select
- tests/ui
- auto-traits
- coherence/occurs-check
7 files changed
+56
-12
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
| 52 | + | |
52 | 53 | | |
53 | 54 | | |
54 | 55 | | |
| |||
1559 | 1560 | | |
1560 | 1561 | | |
1561 | 1562 | | |
| 1563 | + | |
1562 | 1564 | | |
1563 | 1565 | | |
1564 | | - | |
| 1566 | + | |
1565 | 1567 | | |
1566 | 1568 | | |
1567 | 1569 | | |
1568 | | - | |
| 1570 | + | |
1569 | 1571 | | |
1570 | 1572 | | |
1571 | 1573 | | |
| |||
1611 | 1613 | | |
1612 | 1614 | | |
1613 | 1615 | | |
| 1616 | + | |
1614 | 1617 | | |
1615 | 1618 | | |
1616 | 1619 | | |
| |||
1624 | 1627 | | |
1625 | 1628 | | |
1626 | 1629 | | |
1627 | | - | |
| 1630 | + | |
1628 | 1631 | | |
1629 | 1632 | | |
1630 | 1633 | | |
1631 | 1634 | | |
1632 | 1635 | | |
1633 | 1636 | | |
1634 | | - | |
| 1637 | + | |
1635 | 1638 | | |
1636 | 1639 | | |
1637 | 1640 | | |
| |||
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| |||
Lines changed: 21 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 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| |||
| 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 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
7 | | - | |
8 | 6 | | |
9 | 7 | | |
10 | 8 | | |
11 | 9 | | |
12 | 10 | | |
13 | 11 | | |
14 | | - | |
| 12 | + | |
15 | 13 | | |
16 | 14 | | |
17 | 15 | | |
| |||
0 commit comments