rust/library/alloc/src/vec
bors f6648f252a Auto merge of #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](https://github.com/rust-lang/rust/pull/79323#issuecomment-731866746)"

This was first attempted in #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 #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 #83909 was opened instead.

By the time #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]: https://github.com/rust-lang/rust/pull/83359#issuecomment-804450095
[^thinking]: https://github.com/rust-lang/rust/pull/83359#issuecomment-805286704
[^ok]: https://github.com/rust-lang/rust/pull/83359#issuecomment-812739031
[^typo]: https://github.com/rust-lang/rust/pull/83359#issuecomment-812750205
[^remote]: https://github.com/rust-lang/rust/pull/83359#issuecomment-814067119
[^optimizations]: https://github.com/rust-lang/rust/pull/83909#issuecomment-813736593
[^perf2]: https://github.com/rust-lang/rust/pull/83909#issuecomment-813825552
[^ok2]: https://github.com/rust-lang/rust/pull/83909#issuecomment-813831341
[^tests]: https://github.com/rust-lang/rust/pull/83909#issuecomment-825788964
[^conflicts]: https://github.com/rust-lang/rust/pull/83909#issuecomment-851173480
[^rip]: https://github.com/rust-lang/rust/pull/83909#issuecomment-873569771
2024-10-14 02:33:40 +00:00
..
cow.rs Add #[track_caller] to allocating methods of Vec & VecDeque 2024-09-20 01:20:10 +03:00
drain.rs Reformat use declarations. 2024-07-29 08:26:52 +10:00
extract_if.rs Reformat use declarations. 2024-07-29 08:26:52 +10:00
in_place_collect.rs Auto merge of #126557 - GrigorenkoPV:vec_track_caller, r=joboet 2024-10-14 02:33:40 +00:00
in_place_drop.rs Reformat using the new identifier sorting from rustfmt 2024-09-22 19:11:29 -04:00
into_iter.rs Use &raw in the standard library 2024-09-25 17:03:20 -07:00
is_zero.rs Use generic NonZero everywhere in alloc. 2024-02-22 15:17:34 +01:00
mod.rs Auto merge of #126557 - GrigorenkoPV:vec_track_caller, r=joboet 2024-10-14 02:33:40 +00:00
partial_eq.rs Reformat use declarations. 2024-07-29 08:26:52 +10:00
set_len_on_drop.rs Tune RepeatWith::try_fold and Take::for_each and Vec::extend_trusted 2022-11-24 19:14:19 -08:00
spec_extend.rs Add #[track_caller] to allocating methods of Vec & VecDeque 2024-09-20 01:20:10 +03:00
spec_from_elem.rs Add #[track_caller] to allocating methods of Vec & VecDeque 2024-09-20 01:20:10 +03:00
spec_from_iter.rs Add #[track_caller] to allocating methods of Vec & VecDeque 2024-09-20 01:20:10 +03:00
spec_from_iter_nested.rs Add #[track_caller] to allocating methods of Vec & VecDeque 2024-09-20 01:20:10 +03:00
splice.rs Add #[track_caller] to allocating methods of Vec & VecDeque 2024-09-20 01:20:10 +03:00