Skip to content

Commit cbe3620

Browse files
committed
note the leak in insert_many docs
1 parent 562568b commit cbe3620

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -865,6 +865,8 @@ impl<A: Array> SmallVec<A> {
865865

866866
/// Insert multiple elements at position `index`, shifting all following elements toward the
867867
/// back.
868+
///
869+
/// Note: when the iterator panics, this can leak memory.
868870
pub fn insert_many<I: IntoIterator<Item = A::Item>>(&mut self, index: usize, iterable: I) {
869871
let iter = iterable.into_iter();
870872
if index == self.len() {

0 commit comments

Comments
 (0)