From 0d4259e68e5211b99dea028c1b9071362e7f3b6f Mon Sep 17 00:00:00 2001 From: Pavel Grigorenko Date: Sun, 16 Jun 2024 20:03:17 +0300 Subject: Add `#[track_caller]` to allocating methods of `Vec` & `VecDeque` --- library/alloc/src/vec/spec_from_iter_nested.rs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'library/alloc/src/vec/spec_from_iter_nested.rs') diff --git a/library/alloc/src/vec/spec_from_iter_nested.rs b/library/alloc/src/vec/spec_from_iter_nested.rs index 77f7761d22f..22eed238798 100644 --- a/library/alloc/src/vec/spec_from_iter_nested.rs +++ b/library/alloc/src/vec/spec_from_iter_nested.rs @@ -15,6 +15,7 @@ impl SpecFromIterNested for Vec where I: Iterator, { + #[track_caller] default fn from_iter(mut iterator: I) -> Self { // Unroll the first iteration, as the vector is going to be // expanded on this iteration in every case when the iterable is not @@ -47,6 +48,7 @@ impl SpecFromIterNested for Vec where I: TrustedLen, { + #[track_caller] fn from_iter(iterator: I) -> Self { let mut vector = match iterator.size_hint() { (_, Some(upper)) => Vec::with_capacity(upper), -- cgit 1.4.1-3-g733a5