about summary refs log tree commit diff
path: root/library/alloc/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2020-12-13 04:02:26 +0000
committerbors <bors@rust-lang.org>2020-12-13 04:02:26 +0000
commit12813159a985d87a98578e05cc39200e4e8c2102 (patch)
treebc225852487c734031224fd9b9d98d9a251a9818 /library/alloc/src
parentdd11f45a685213228242b0465d7c077208e492f5 (diff)
parent3213089c0292a5e3a1c0eae1ef845964eb91c51c (diff)
downloadrust-12813159a985d87a98578e05cc39200e4e8c2102.tar.gz
rust-12813159a985d87a98578e05cc39200e4e8c2102.zip
Auto merge of #79994 - JohnTitor:rollup-43wl2uj, r=JohnTitor
Rollup of 12 pull requests

Successful merges:

 - #79360 (std::iter: document iteration over `&T` and `&mut T`)
 - #79398 (Link loop/for keyword)
 - #79834 (Remove deprecated linked_list_extras methods.)
 - #79845 (Fix rustup support in default_build_triple for python3)
 - #79940 (fix more clippy::complexity findings)
 - #79942 (Add post-init hook for static memory for miri.)
 - #79954 (Fix building compiler docs with stage 0)
 - #79963 (Fix typo in `DebruijnIndex` documentation)
 - #79970 (Misc rustbuild improvements when the LLVM backend isn't used)
 - #79973 (rustdoc light theme: Fix CSS for selected buttons)
 - #79984 (Remove an unused dependency that made `rustdoc` crash)
 - #79985 (Fixes submit event of the search input)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'library/alloc/src')
-rw-r--r--library/alloc/src/collections/linked_list.rs62
1 files changed, 0 insertions, 62 deletions
diff --git a/library/alloc/src/collections/linked_list.rs b/library/alloc/src/collections/linked_list.rs
index 412c65681e6..4707f129401 100644
--- a/library/alloc/src/collections/linked_list.rs
+++ b/library/alloc/src/collections/linked_list.rs
@@ -1099,68 +1099,6 @@ impl<T> ExactSizeIterator for IterMut<'_, T> {}
 #[stable(feature = "fused", since = "1.26.0")]
 impl<T> FusedIterator for IterMut<'_, T> {}
 
-impl<T> IterMut<'_, T> {
-    /// Inserts the given element just after the element most recently returned by `.next()`.
-    /// The inserted element does not appear in the iteration.
-    ///
-    /// This method will be removed soon.
-    #[inline]
-    #[unstable(
-        feature = "linked_list_extras",
-        reason = "this is probably better handled by a cursor type -- we'll see",
-        issue = "27794"
-    )]
-    #[rustc_deprecated(
-        reason = "Deprecated in favor of CursorMut methods. This method will be removed soon.",
-        since = "1.47.0"
-    )]
-    pub fn insert_next(&mut self, element: T) {
-        match self.head {
-            // `push_back` is okay with aliasing `element` references
-            None => self.list.push_back(element),
-            Some(head) => unsafe {
-                let prev = match head.as_ref().prev {
-                    // `push_front` is okay with aliasing nodes
-                    None => return self.list.push_front(element),
-                    Some(prev) => prev,
-                };
-
-                let node = Some(
-                    Box::leak(box Node { next: Some(head), prev: Some(prev), element }).into(),
-                );
-
-                // Not creating references to entire nodes to not invalidate the
-                // reference to `element` we handed to the user.
-                (*prev.as_ptr()).next = node;
-                (*head.as_ptr()).prev = node;
-
-                self.list.len += 1;
-            },
-        }
-    }
-
-    /// Provides a reference to the next element, without changing the iterator.
-    ///
-    /// This method will be removed soon.
-    #[inline]
-    #[unstable(
-        feature = "linked_list_extras",
-        reason = "this is probably better handled by a cursor type -- we'll see",
-        issue = "27794"
-    )]
-    #[rustc_deprecated(
-        reason = "Deprecated in favor of CursorMut methods. This method will be removed soon.",
-        since = "1.47.0"
-    )]
-    pub fn peek_next(&mut self) -> Option<&mut T> {
-        if self.len == 0 {
-            None
-        } else {
-            unsafe { self.head.as_mut().map(|node| &mut node.as_mut().element) }
-        }
-    }
-}
-
 /// A cursor over a `LinkedList`.
 ///
 /// A `Cursor` is like an iterator, except that it can freely seek back-and-forth.