diff --git a/library/alloc/src/vec/mod.rs b/library/alloc/src/vec/mod.rs index 06a7c335bf05d..61e018285ce66 100644 --- a/library/alloc/src/vec/mod.rs +++ b/library/alloc/src/vec/mod.rs @@ -1360,6 +1360,12 @@ impl Vec { /// Removes and returns the element at position `index` within the vector, /// shifting all elements after it to the left. /// + /// Note: Because this shifts over the remaining elements, it has a + /// worst-case performance of O(n). If you don't need the order of elements + /// to be preserved, use [`swap_remove`] instead. + /// + /// [`swap_remove`]: Vec::swap_remove + /// /// # Panics /// /// Panics if `index` is out of bounds.