This repository was archived by the owner on May 28, 2025. It is now read-only.
Commit d1a0fa5
committed
Auto merge of rust-lang#118441 - GuillaumeGomez:display-stability-version, r=rustdoc
Always display stability version even if it's the same as the containing item
Fixes rust-lang#118439.
Currently, if the containing item's version is the same as the item's version (like a method), we don't display it on the item.
This was something done on purpose as you can see [here](https://github.com/rust-lang/rust/blob/e9b7bf011478aa8c19ac49afc99853a66ba04319/src/librustdoc/html/render/mod.rs#L949-L955). It was implemented in rust-lang#30686.
I think we should change this because on pages with a lot of items, if someone arrives (through the search or a link) to an item far below the page, they won't know the stability version unless they scroll to the top, which isn't great.
You can see the result [here](https://rustdoc.crud.net/imperio/display-stability-version/std/pin/struct.Pin.html#method.new).
r? `@notriddle`File tree
7 files changed
+19
-66
lines changed- src/librustdoc
- clean
- html/render
- tests/rustdoc
- deref
7 files changed
+19
-66
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
600 | 600 | | |
601 | 601 | | |
602 | 602 | | |
603 | | - | |
604 | | - | |
605 | | - | |
606 | | - | |
607 | | - | |
608 | | - | |
609 | | - | |
610 | 603 | | |
611 | 604 | | |
612 | 605 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
996 | 996 | | |
997 | 997 | | |
998 | 998 | | |
999 | | - | |
| 999 | + | |
1000 | 1000 | | |
1001 | | - | |
1002 | | - | |
1003 | 1001 | | |
1004 | 1002 | | |
1005 | | - | |
1006 | | - | |
1007 | | - | |
1008 | | - | |
1009 | | - | |
1010 | | - | |
1011 | | - | |
1012 | | - | |
1013 | 1003 | | |
1014 | 1004 | | |
1015 | 1005 | | |
1016 | | - | |
1017 | | - | |
1018 | | - | |
| 1006 | + | |
| 1007 | + | |
| 1008 | + | |
1019 | 1009 | | |
1020 | 1010 | | |
1021 | 1011 | | |
1022 | | - | |
1023 | | - | |
1024 | | - | |
| 1012 | + | |
1025 | 1013 | | |
1026 | 1014 | | |
1027 | 1015 | | |
| |||
1076 | 1064 | | |
1077 | 1065 | | |
1078 | 1066 | | |
1079 | | - | |
1080 | | - | |
1081 | 1067 | | |
1082 | | - | |
1083 | | - | |
1084 | | - | |
1085 | | - | |
1086 | | - | |
1087 | | - | |
1088 | | - | |
1089 | | - | |
| 1068 | + | |
1090 | 1069 | | |
1091 | 1070 | | |
1092 | 1071 | | |
| |||
1585 | 1564 | | |
1586 | 1565 | | |
1587 | 1566 | | |
1588 | | - | |
1589 | 1567 | | |
1590 | 1568 | | |
1591 | 1569 | | |
| |||
1681 | 1659 | | |
1682 | 1660 | | |
1683 | 1661 | | |
1684 | | - | |
| 1662 | + | |
1685 | 1663 | | |
1686 | 1664 | | |
1687 | 1665 | | |
| |||
1703 | 1681 | | |
1704 | 1682 | | |
1705 | 1683 | | |
1706 | | - | |
| 1684 | + | |
1707 | 1685 | | |
1708 | 1686 | | |
1709 | 1687 | | |
| |||
1789 | 1767 | | |
1790 | 1768 | | |
1791 | 1769 | | |
1792 | | - | |
1793 | 1770 | | |
1794 | 1771 | | |
1795 | 1772 | | |
| |||
1805 | 1782 | | |
1806 | 1783 | | |
1807 | 1784 | | |
1808 | | - | |
1809 | 1785 | | |
1810 | 1786 | | |
1811 | 1787 | | |
| |||
1833 | 1809 | | |
1834 | 1810 | | |
1835 | 1811 | | |
1836 | | - | |
1837 | 1812 | | |
1838 | 1813 | | |
1839 | 1814 | | |
| |||
1856 | 1831 | | |
1857 | 1832 | | |
1858 | 1833 | | |
1859 | | - | |
1860 | 1834 | | |
1861 | 1835 | | |
1862 | 1836 | | |
| |||
1878 | 1852 | | |
1879 | 1853 | | |
1880 | 1854 | | |
1881 | | - | |
1882 | 1855 | | |
1883 | 1856 | | |
1884 | 1857 | | |
| |||
1926 | 1899 | | |
1927 | 1900 | | |
1928 | 1901 | | |
1929 | | - | |
1930 | | - | |
1931 | | - | |
1932 | | - | |
1933 | | - | |
1934 | | - | |
1935 | | - | |
| 1902 | + | |
1936 | 1903 | | |
1937 | 1904 | | |
1938 | 1905 | | |
1939 | 1906 | | |
1940 | | - | |
1941 | | - | |
1942 | | - | |
| 1907 | + | |
| 1908 | + | |
| 1909 | + | |
1943 | 1910 | | |
1944 | 1911 | | |
1945 | 1912 | | |
| |||
1949 | 1916 | | |
1950 | 1917 | | |
1951 | 1918 | | |
1952 | | - | |
1953 | | - | |
1954 | 1919 | | |
1955 | 1920 | | |
1956 | 1921 | | |
| |||
1972 | 1937 | | |
1973 | 1938 | | |
1974 | 1939 | | |
1975 | | - | |
1976 | 1940 | | |
1977 | 1941 | | |
1978 | 1942 | | |
| |||
1987 | 1951 | | |
1988 | 1952 | | |
1989 | 1953 | | |
1990 | | - | |
| 1954 | + | |
1991 | 1955 | | |
1992 | 1956 | | |
1993 | 1957 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
214 | 214 | | |
215 | 215 | | |
216 | 216 | | |
217 | | - | |
218 | | - | |
219 | 217 | | |
220 | 218 | | |
221 | 219 | | |
| |||
825 | 823 | | |
826 | 824 | | |
827 | 825 | | |
828 | | - | |
| 826 | + | |
829 | 827 | | |
830 | 828 | | |
831 | 829 | | |
| |||
1686 | 1684 | | |
1687 | 1685 | | |
1688 | 1686 | | |
1689 | | - | |
1690 | | - | |
1691 | 1687 | | |
1692 | 1688 | | |
1693 | 1689 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
75 | | - | |
76 | | - | |
| 75 | + | |
| 76 | + | |
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
| 29 | + | |
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
20 | 20 | | |
21 | 21 | | |
0 commit comments