Commit 290117f
authored
Rollup merge of #82564 - WaffleLapkin:revert_spare_mut, r=RalfJung
Revert `Vec::spare_capacity_mut` impl to prevent pointers invalidation
The implementation was changed in #79015.
Later it was [pointed out](#81944 (comment)) that the implementation invalidates pointers to the buffer (initialized elements) by creating a unique reference to the buffer. This PR reverts the implementation.
r? ```@RalfJung```3 files changed
+19
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1877 | 1877 | | |
1878 | 1878 | | |
1879 | 1879 | | |
1880 | | - | |
| 1880 | + | |
| 1881 | + | |
| 1882 | + | |
| 1883 | + | |
| 1884 | + | |
| 1885 | + | |
| 1886 | + | |
| 1887 | + | |
| 1888 | + | |
1881 | 1889 | | |
1882 | 1890 | | |
1883 | 1891 | | |
| |||
1934 | 1942 | | |
1935 | 1943 | | |
1936 | 1944 | | |
1937 | | - | |
1938 | | - | |
1939 | | - | |
1940 | | - | |
1941 | | - | |
1942 | | - | |
1943 | | - | |
| 1945 | + | |
| 1946 | + | |
| 1947 | + | |
1944 | 1948 | | |
1945 | 1949 | | |
1946 | 1950 | | |
1947 | | - | |
| 1951 | + | |
1948 | 1952 | | |
1949 | 1953 | | |
1950 | | - | |
| 1954 | + | |
1951 | 1955 | | |
1952 | 1956 | | |
1953 | 1957 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1691 | 1691 | | |
1692 | 1692 | | |
1693 | 1693 | | |
| 1694 | + | |
| 1695 | + | |
| 1696 | + | |
| 1697 | + | |
1694 | 1698 | | |
1695 | 1699 | | |
1696 | 1700 | | |
| |||
0 commit comments