about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/liballoc/tests/lib.rs1
-rw-r--r--src/liballoc/tests/vec.rs15
-rw-r--r--src/liballoc/vec.rs18
-rw-r--r--src/librustc_middle/lib.rs1
-rw-r--r--src/librustc_query_system/lib.rs1
-rw-r--r--src/librustc_query_system/query/job.rs4
-rw-r--r--src/librustdoc/lib.rs1
-rw-r--r--src/tools/compiletest/src/main.rs1
8 files changed, 11 insertions, 31 deletions
diff --git a/src/liballoc/tests/lib.rs b/src/liballoc/tests/lib.rs
index f3da46bd0cc..e2dc816b015 100644
--- a/src/liballoc/tests/lib.rs
+++ b/src/liballoc/tests/lib.rs
@@ -12,7 +12,6 @@
 #![feature(associated_type_bounds)]
 #![feature(binary_heap_into_iter_sorted)]
 #![feature(binary_heap_drain_sorted)]
-#![feature(vec_remove_item)]
 #![feature(split_inclusive)]
 #![feature(binary_heap_retain)]
 
diff --git a/src/liballoc/tests/vec.rs b/src/liballoc/tests/vec.rs
index a9813a8704f..baa02b8997f 100644
--- a/src/liballoc/tests/vec.rs
+++ b/src/liballoc/tests/vec.rs
@@ -132,21 +132,6 @@ fn test_extend_ref() {
 }
 
 #[test]
-fn test_remove_item() {
-    let mut v = vec![1, 2, 3];
-    v.remove_item(&1);
-
-    assert_eq!(v.len(), 2);
-    assert_eq!(v, [2, 3]);
-
-    let mut w = vec![1, 2, 3];
-    w.remove_item(&4);
-
-    assert_eq!(w.len(), 3);
-    w.remove_item(&4);
-}
-
-#[test]
 fn test_slice_from_mut() {
     let mut values = vec![1, 2, 3, 4, 5];
     {
diff --git a/src/liballoc/vec.rs b/src/liballoc/vec.rs
index 95c3b3b1861..0531084d0e4 100644
--- a/src/liballoc/vec.rs
+++ b/src/liballoc/vec.rs
@@ -1760,17 +1760,15 @@ impl<T: PartialEq> Vec<T> {
 impl<T> Vec<T> {
     /// Removes the first instance of `item` from the vector if the item exists.
     ///
-    /// # Examples
-    ///
-    /// ```
-    /// # #![feature(vec_remove_item)]
-    /// let mut vec = vec![1, 2, 3, 1];
-    ///
-    /// vec.remove_item(&1);
-    ///
-    /// assert_eq!(vec, vec![2, 3, 1]);
-    /// ```
+    /// 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>,
diff --git a/src/librustc_middle/lib.rs b/src/librustc_middle/lib.rs
index 62c92e988ba..8025246f3d6 100644
--- a/src/librustc_middle/lib.rs
+++ b/src/librustc_middle/lib.rs
@@ -45,7 +45,6 @@
 #![feature(min_specialization)]
 #![feature(track_caller)]
 #![feature(trusted_len)]
-#![feature(vec_remove_item)]
 #![feature(stmt_expr_attributes)]
 #![feature(test)]
 #![feature(in_band_lifetimes)]
diff --git a/src/librustc_query_system/lib.rs b/src/librustc_query_system/lib.rs
index 12450a4ccd3..3afc4565933 100644
--- a/src/librustc_query_system/lib.rs
+++ b/src/librustc_query_system/lib.rs
@@ -6,7 +6,6 @@
 #![feature(hash_raw_entry)]
 #![feature(min_specialization)]
 #![feature(stmt_expr_attributes)]
-#![feature(vec_remove_item)]
 
 #[macro_use]
 extern crate log;
diff --git a/src/librustc_query_system/query/job.rs b/src/librustc_query_system/query/job.rs
index 5150b278a77..190312bb330 100644
--- a/src/librustc_query_system/query/job.rs
+++ b/src/librustc_query_system/query/job.rs
@@ -452,7 +452,9 @@ fn remove_cycle<CTX: QueryContext>(
 
         // Remove the queries in our cycle from the list of jobs to look at
         for r in &stack {
-            jobs.remove_item(&r.1);
+            if let Some(pos) = jobs.iter().position(|j| j == &r.1) {
+                jobs.remove(pos);
+            }
         }
 
         // Find the queries in the cycle which are
diff --git a/src/librustdoc/lib.rs b/src/librustdoc/lib.rs
index 95d113166e0..de6fa3dbd4a 100644
--- a/src/librustdoc/lib.rs
+++ b/src/librustdoc/lib.rs
@@ -9,7 +9,6 @@
 #![feature(nll)]
 #![feature(or_patterns)]
 #![feature(test)]
-#![feature(vec_remove_item)]
 #![feature(ptr_offset_from)]
 #![feature(crate_visibility_modifier)]
 #![feature(never_type)]
diff --git a/src/tools/compiletest/src/main.rs b/src/tools/compiletest/src/main.rs
index 93c53e779d5..c00b0f02c3a 100644
--- a/src/tools/compiletest/src/main.rs
+++ b/src/tools/compiletest/src/main.rs
@@ -1,5 +1,4 @@
 #![crate_name = "compiletest"]
-#![feature(vec_remove_item)]
 #![deny(warnings)]
 // The `test` crate is the only unstable feature
 // allowed here, just to share similar code.