Commit d6318f3
committed
Auto merge of rust-lang#126557 - GrigorenkoPV:vec_track_caller, r=joboet
Add `#[track_caller]` to allocating methods of `Vec` & `VecDeque`
Part 4 in a lengthy saga.
r? `@joshtriplett` because they were the reviewer the last 3 times.
`@bors` rollup=never "[just in case this has perf effects, Vec is hot](rust-lang#79323 (comment))"
This was first attempted in rust-lang#79323 by `@nvzqz.` It got approval from `@joshtriplett,` but rotted with merge conflicts and got closed.
Then it got picked up by `@Dylan-DPC-zz` in rust-lang#83359. A benchmark was run[^perf], the results (after a bit of thinking[^thinking]) were deemed ok[^ok], but there was a typo[^typo] and the PR was made from a wrong remote in the first place[^remote], so rust-lang#83909 was opened instead.
By the time rust-lang#83909 rolled around, the methods in question had received some optimizations[^optimizations], so another perf run was conducted[^perf2]. The results were ok[^ok2]. There was a suggestion to add regression tests for panic behavior [^tests], but before it could be addressed, the PR fell victim to merge conflicts[^conflicts] and died again[^rip].
3 years have passed, and (from what I can tell) this has not been tried again, so here I am now, reviving this old effort.
Given how much time has passed and the fact that I've also touched `VecDeque` this time, it probably makes sense to
`@bors` try `@rust-timer`
[^perf]: rust-lang#83359 (comment)
[^thinking]: rust-lang#83359 (comment)
[^ok]: rust-lang#83359 (comment)
[^typo]: rust-lang#83359 (comment)
[^remote]: rust-lang#83359 (comment)
[^optimizations]: rust-lang#83909 (comment)
[^perf2]: rust-lang#83909 (comment)
[^ok2]: rust-lang#83909 (comment)
[^tests]: rust-lang#83909 (comment)
[^conflicts]: rust-lang#83909 (comment)
[^rip]: rust-lang#83909 (comment)File tree
12 files changed
+105
-0
lines changed- alloc/src
- collections/vec_deque
- vec
12 files changed
+105
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
| 106 | + | |
106 | 107 | | |
107 | 108 | | |
108 | 109 | | |
| |||
113 | 114 | | |
114 | 115 | | |
115 | 116 | | |
| 117 | + | |
116 | 118 | | |
117 | 119 | | |
118 | 120 | | |
| |||
570 | 572 | | |
571 | 573 | | |
572 | 574 | | |
| 575 | + | |
573 | 576 | | |
574 | 577 | | |
575 | 578 | | |
| |||
625 | 628 | | |
626 | 629 | | |
627 | 630 | | |
| 631 | + | |
628 | 632 | | |
629 | 633 | | |
630 | 634 | | |
| |||
789 | 793 | | |
790 | 794 | | |
791 | 795 | | |
| 796 | + | |
792 | 797 | | |
793 | 798 | | |
794 | 799 | | |
| |||
818 | 823 | | |
819 | 824 | | |
820 | 825 | | |
| 826 | + | |
821 | 827 | | |
822 | 828 | | |
823 | 829 | | |
| |||
949 | 955 | | |
950 | 956 | | |
951 | 957 | | |
| 958 | + | |
952 | 959 | | |
953 | 960 | | |
954 | 961 | | |
| |||
974 | 981 | | |
975 | 982 | | |
976 | 983 | | |
| 984 | + | |
977 | 985 | | |
978 | 986 | | |
979 | 987 | | |
| |||
1740 | 1748 | | |
1741 | 1749 | | |
1742 | 1750 | | |
| 1751 | + | |
1743 | 1752 | | |
1744 | 1753 | | |
1745 | 1754 | | |
| |||
1767 | 1776 | | |
1768 | 1777 | | |
1769 | 1778 | | |
| 1779 | + | |
1770 | 1780 | | |
1771 | 1781 | | |
1772 | 1782 | | |
| |||
1876 | 1886 | | |
1877 | 1887 | | |
1878 | 1888 | | |
| 1889 | + | |
1879 | 1890 | | |
1880 | 1891 | | |
1881 | 1892 | | |
| |||
1979 | 1990 | | |
1980 | 1991 | | |
1981 | 1992 | | |
| 1993 | + | |
1982 | 1994 | | |
1983 | 1995 | | |
1984 | 1996 | | |
| |||
2045 | 2057 | | |
2046 | 2058 | | |
2047 | 2059 | | |
| 2060 | + | |
2048 | 2061 | | |
2049 | 2062 | | |
2050 | 2063 | | |
| |||
2167 | 2180 | | |
2168 | 2181 | | |
2169 | 2182 | | |
| 2183 | + | |
2170 | 2184 | | |
2171 | 2185 | | |
2172 | 2186 | | |
| |||
2205 | 2219 | | |
2206 | 2220 | | |
2207 | 2221 | | |
| 2222 | + | |
2208 | 2223 | | |
2209 | 2224 | | |
2210 | 2225 | | |
| |||
2751 | 2766 | | |
2752 | 2767 | | |
2753 | 2768 | | |
| 2769 | + | |
2754 | 2770 | | |
2755 | 2771 | | |
2756 | 2772 | | |
| |||
2870 | 2886 | | |
2871 | 2887 | | |
2872 | 2888 | | |
| 2889 | + | |
2873 | 2890 | | |
2874 | 2891 | | |
2875 | 2892 | | |
| |||
2909 | 2926 | | |
2910 | 2927 | | |
2911 | 2928 | | |
| 2929 | + | |
2912 | 2930 | | |
2913 | 2931 | | |
2914 | 2932 | | |
2915 | 2933 | | |
2916 | 2934 | | |
| 2935 | + | |
2917 | 2936 | | |
2918 | 2937 | | |
2919 | 2938 | | |
2920 | 2939 | | |
2921 | 2940 | | |
| 2941 | + | |
2922 | 2942 | | |
2923 | 2943 | | |
2924 | 2944 | | |
| |||
2934 | 2954 | | |
2935 | 2955 | | |
2936 | 2956 | | |
| 2957 | + | |
2937 | 2958 | | |
2938 | 2959 | | |
2939 | 2960 | | |
2940 | 2961 | | |
2941 | 2962 | | |
| 2963 | + | |
2942 | 2964 | | |
2943 | 2965 | | |
2944 | 2966 | | |
2945 | 2967 | | |
2946 | 2968 | | |
| 2969 | + | |
2947 | 2970 | | |
2948 | 2971 | | |
2949 | 2972 | | |
| |||
3041 | 3064 | | |
3042 | 3065 | | |
3043 | 3066 | | |
| 3067 | + | |
3044 | 3068 | | |
3045 | 3069 | | |
3046 | 3070 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| 18 | + | |
17 | 19 | | |
18 | 20 | | |
19 | 21 | | |
| |||
44 | 46 | | |
45 | 47 | | |
46 | 48 | | |
| 49 | + | |
47 | 50 | | |
48 | 51 | | |
49 | 52 | | |
| |||
76 | 79 | | |
77 | 80 | | |
78 | 81 | | |
| 82 | + | |
79 | 83 | | |
80 | 84 | | |
81 | 85 | | |
| |||
93 | 97 | | |
94 | 98 | | |
95 | 99 | | |
| 100 | + | |
96 | 101 | | |
97 | 102 | | |
98 | 103 | | |
| |||
102 | 107 | | |
103 | 108 | | |
104 | 109 | | |
| 110 | + | |
105 | 111 | | |
106 | 112 | | |
107 | 113 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
| |||
125 | 126 | | |
126 | 127 | | |
127 | 128 | | |
| 129 | + | |
128 | 130 | | |
129 | 131 | | |
130 | 132 | | |
| |||
133 | 135 | | |
134 | 136 | | |
135 | 137 | | |
| 138 | + | |
136 | 139 | | |
137 | 140 | | |
138 | 141 | | |
| |||
145 | 148 | | |
146 | 149 | | |
147 | 150 | | |
| 151 | + | |
148 | 152 | | |
149 | 153 | | |
150 | 154 | | |
| |||
184 | 188 | | |
185 | 189 | | |
186 | 190 | | |
| 191 | + | |
187 | 192 | | |
188 | 193 | | |
189 | 194 | | |
| |||
205 | 210 | | |
206 | 211 | | |
207 | 212 | | |
| 213 | + | |
208 | 214 | | |
209 | 215 | | |
210 | 216 | | |
| |||
324 | 330 | | |
325 | 331 | | |
326 | 332 | | |
| 333 | + | |
327 | 334 | | |
328 | 335 | | |
329 | 336 | | |
| |||
332 | 339 | | |
333 | 340 | | |
334 | 341 | | |
| 342 | + | |
335 | 343 | | |
336 | 344 | | |
337 | 345 | | |
| |||
359 | 367 | | |
360 | 368 | | |
361 | 369 | | |
| 370 | + | |
362 | 371 | | |
363 | 372 | | |
364 | 373 | | |
| |||
383 | 392 | | |
384 | 393 | | |
385 | 394 | | |
| 395 | + | |
386 | 396 | | |
387 | 397 | | |
388 | 398 | | |
| |||
408 | 418 | | |
409 | 419 | | |
410 | 420 | | |
| 421 | + | |
411 | 422 | | |
412 | 423 | | |
413 | 424 | | |
| |||
432 | 443 | | |
433 | 444 | | |
434 | 445 | | |
| 446 | + | |
435 | 447 | | |
436 | 448 | | |
437 | 449 | | |
| |||
526 | 538 | | |
527 | 539 | | |
528 | 540 | | |
| 541 | + | |
529 | 542 | | |
530 | 543 | | |
531 | 544 | | |
| |||
550 | 563 | | |
551 | 564 | | |
552 | 565 | | |
| 566 | + | |
553 | 567 | | |
554 | 568 | | |
555 | 569 | | |
| |||
573 | 587 | | |
574 | 588 | | |
575 | 589 | | |
| 590 | + | |
576 | 591 | | |
577 | 592 | | |
578 | 593 | | |
| |||
597 | 612 | | |
598 | 613 | | |
599 | 614 | | |
| 615 | + | |
600 | 616 | | |
601 | 617 | | |
602 | 618 | | |
| |||
770 | 786 | | |
771 | 787 | | |
772 | 788 | | |
| 789 | + | |
773 | 790 | | |
774 | 791 | | |
775 | 792 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
| 61 | + | |
61 | 62 | | |
62 | 63 | | |
63 | 64 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
229 | 229 | | |
230 | 230 | | |
231 | 231 | | |
| 232 | + | |
232 | 233 | | |
233 | 234 | | |
234 | 235 | | |
| |||
246 | 247 | | |
247 | 248 | | |
248 | 249 | | |
| 250 | + | |
249 | 251 | | |
250 | 252 | | |
251 | 253 | | |
| |||
0 commit comments