about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMara Bos <m-ou.se@m-ou.se>2021-01-14 18:00:18 +0000
committerGitHub <noreply@github.com>2021-01-14 18:00:18 +0000
commit9bfe6f1b2cae1907151580a40e2dad29ad8aef8c (patch)
treeb08afc9a4cc5b79c0c55a6947c389932158a0cfe
parent90cc815829acacc1ccb831db4134ef3198cbb3b7 (diff)
parent7e83fece9159463746a53242b2c6c795a47ccf9b (diff)
downloadrust-9bfe6f1b2cae1907151580a40e2dad29ad8aef8c.tar.gz
rust-9bfe6f1b2cae1907151580a40e2dad29ad8aef8c.zip
Rollup merge of #80972 - KodrAus:deprecate/remove_item, r=nagisa
Remove unstable deprecated Vec::remove_item

Closes #40062

The `Vec::remove_item` method was deprecated in `1.46.0` (in August of 2020). This PR now removes that unstable method entirely.
-rw-r--r--library/alloc/src/vec/mod.rs21
1 files changed, 0 insertions, 21 deletions
diff --git a/library/alloc/src/vec/mod.rs b/library/alloc/src/vec/mod.rs
index 1ca194c3361..ccc4f03a1e5 100644
--- a/library/alloc/src/vec/mod.rs
+++ b/library/alloc/src/vec/mod.rs
@@ -1953,27 +1953,6 @@ impl<T: PartialEq, A: Allocator> Vec<T, A> {
     }
 }
 
-impl<T, A: Allocator> Vec<T, A> {
-    /// Removes the first instance of `item` from the vector if the item exists.
-    ///
-    /// This method will be removed soon.
-    #[unstable(feature = "vec_remove_item", reason = "recently added", issue = "40062")]
-    #[rustc_deprecated(
-        reason = "Removing the first item equal to a needle is already easily possible \
-            with iterators and the current Vec methods. Furthermore, having a method for \
-            one particular case of removal (linear search, only the first item, no swap remove) \
-            but not for others is inconsistent. This method will be removed soon.",
-        since = "1.46.0"
-    )]
-    pub fn remove_item<V>(&mut self, item: &V) -> Option<T>
-    where
-        T: PartialEq<V>,
-    {
-        let pos = self.iter().position(|x| *x == *item)?;
-        Some(self.remove(pos))
-    }
-}
-
 ////////////////////////////////////////////////////////////////////////////////
 // Internal methods and functions
 ////////////////////////////////////////////////////////////////////////////////