Commit 3250240
authored
Rollup merge of #86506 - b-naber:gen_trait_impl_inconsistent, r=jackh726
Don't normalize xform_ret_ty during method candidate assembly
Fixes #85671
Normalizing the return type of a method candidate together with the expected receiver type of the method can lead to valid method candidates being rejected during probing. Specifically in the example of the fixed issue we have a `self_ty` of the form `&A<&[Coef]>` whereas the `impl_ty` of the method would be `&A<_>`, if we normalize the projection in the return type we unify the inference variable with `Cont`, which will lead us to reject the candidate in the sup type check in `consider_probe`. Since we don't actually need the normalized return type during candidate assembly, we postpone the normalization until we consider candidates in `consider_probe`.File tree
6 files changed
+74
-14
lines changed- compiler/rustc_typeck/src/check/method
- src/test/ui
- issues/issue-50264-inner-deref-trait
- resolve
6 files changed
+74
-14
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
753 | 753 | | |
754 | 754 | | |
755 | 755 | | |
| 756 | + | |
| 757 | + | |
756 | 758 | | |
757 | | - | |
| 759 | + | |
| 760 | + | |
758 | 761 | | |
759 | 762 | | |
760 | 763 | | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
761 | 771 | | |
762 | 772 | | |
763 | | - | |
764 | | - | |
| 773 | + | |
| 774 | + | |
765 | 775 | | |
766 | | - | |
| 776 | + | |
767 | 777 | | |
768 | 778 | | |
769 | 779 | | |
| |||
1420 | 1430 | | |
1421 | 1431 | | |
1422 | 1432 | | |
| 1433 | + | |
| 1434 | + | |
| 1435 | + | |
1423 | 1436 | | |
1424 | 1437 | | |
1425 | 1438 | | |
| |||
1428 | 1441 | | |
1429 | 1442 | | |
1430 | 1443 | | |
1431 | | - | |
| 1444 | + | |
| 1445 | + | |
| 1446 | + | |
| 1447 | + | |
| 1448 | + | |
| 1449 | + | |
| 1450 | + | |
| 1451 | + | |
| 1452 | + | |
| 1453 | + | |
| 1454 | + | |
1432 | 1455 | | |
1433 | 1456 | | |
1434 | 1457 | | |
| |||
1442 | 1465 | | |
1443 | 1466 | | |
1444 | 1467 | | |
1445 | | - | |
| 1468 | + | |
| 1469 | + | |
| 1470 | + | |
1446 | 1471 | | |
1447 | 1472 | | |
1448 | 1473 | | |
| |||
1527 | 1552 | | |
1528 | 1553 | | |
1529 | 1554 | | |
1530 | | - | |
1531 | | - | |
1532 | | - | |
| 1555 | + | |
1533 | 1556 | | |
1534 | 1557 | | |
1535 | 1558 | | |
| |||
1669 | 1692 | | |
1670 | 1693 | | |
1671 | 1694 | | |
| 1695 | + | |
1672 | 1696 | | |
1673 | 1697 | | |
1674 | 1698 | | |
| |||
1683 | 1707 | | |
1684 | 1708 | | |
1685 | 1709 | | |
| 1710 | + | |
1686 | 1711 | | |
1687 | 1712 | | |
1688 | | - | |
| 1713 | + | |
1689 | 1714 | | |
1690 | 1715 | | |
1691 | 1716 | | |
| |||
Lines changed: 0 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
10 | 9 | | |
11 | 10 | | |
12 | 11 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| |||
Lines changed: 0 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
10 | 9 | | |
11 | 10 | | |
12 | 11 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| |||
| 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 | + | |
0 commit comments