Commit 3e4856c
authored
Rollup merge of rust-lang#139357 - miried:master, r=Amanieu
Fix parameter order for `_by()` variants of `min` / `max`/ `minmax` in `std::cmp`
We saw a regression introduced in version `1.86` that seems to be coming from switching the order of `v1` and `v2` when calling `comparison` functions in `min_by` / `max_by` / `minmax_by` (cf. this PR: rust-lang#136307)
When the `compare` function is not symmetric in the arguments, this leads to false results. Apparently, the test cases do not cover this scenario currently. While asymmetric comparison may be an edge case, but current behavior is unexpected nevertheless.1 file changed
+12
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1554 | 1554 | | |
1555 | 1555 | | |
1556 | 1556 | | |
| 1557 | + | |
| 1558 | + | |
| 1559 | + | |
1557 | 1560 | | |
1558 | 1561 | | |
1559 | 1562 | | |
| |||
1574 | 1577 | | |
1575 | 1578 | | |
1576 | 1579 | | |
1577 | | - | |
| 1580 | + | |
1578 | 1581 | | |
1579 | 1582 | | |
1580 | 1583 | | |
| |||
1646 | 1649 | | |
1647 | 1650 | | |
1648 | 1651 | | |
| 1652 | + | |
| 1653 | + | |
| 1654 | + | |
1649 | 1655 | | |
1650 | 1656 | | |
1651 | 1657 | | |
| |||
1666 | 1672 | | |
1667 | 1673 | | |
1668 | 1674 | | |
1669 | | - | |
| 1675 | + | |
1670 | 1676 | | |
1671 | 1677 | | |
1672 | 1678 | | |
| |||
1745 | 1751 | | |
1746 | 1752 | | |
1747 | 1753 | | |
| 1754 | + | |
| 1755 | + | |
| 1756 | + | |
1748 | 1757 | | |
1749 | 1758 | | |
1750 | 1759 | | |
| |||
1769 | 1778 | | |
1770 | 1779 | | |
1771 | 1780 | | |
1772 | | - | |
| 1781 | + | |
1773 | 1782 | | |
1774 | 1783 | | |
1775 | 1784 | | |
| |||
0 commit comments