@@ -1110,32 +1110,17 @@ impl<T> IterMut<'_, T> {
11101110 /// Inserts the given element just after the element most recently returned by `.next()`.
11111111 /// The inserted element does not appear in the iteration.
11121112 ///
1113- /// # Examples
1114- ///
1115- /// ```
1116- /// #![feature(linked_list_extras)]
1117- ///
1118- /// use std::collections::LinkedList;
1119- ///
1120- /// let mut list: LinkedList<_> = vec![1, 3, 4].into_iter().collect();
1121- ///
1122- /// {
1123- /// let mut it = list.iter_mut();
1124- /// assert_eq!(it.next().unwrap(), &1);
1125- /// // insert `2` after `1`
1126- /// it.insert_next(2);
1127- /// }
1128- /// {
1129- /// let vec: Vec<_> = list.into_iter().collect();
1130- /// assert_eq!(vec, [1, 2, 3, 4]);
1131- /// }
1132- /// ```
1113+ /// This method will be removed soon.
11331114 #[ inline]
11341115 #[ unstable(
11351116 feature = "linked_list_extras" ,
11361117 reason = "this is probably better handled by a cursor type -- we'll see" ,
11371118 issue = "27794"
11381119 ) ]
1120+ #[ rustc_deprecated(
1121+ reason = "Deprecated in favor of CursorMut methods. This method will be removed soon." ,
1122+ since = "1.47.0"
1123+ ) ]
11391124 pub fn insert_next ( & mut self , element : T ) {
11401125 match self . head {
11411126 // `push_back` is okay with aliasing `element` references
@@ -1163,27 +1148,17 @@ impl<T> IterMut<'_, T> {
11631148
11641149 /// Provides a reference to the next element, without changing the iterator.
11651150 ///
1166- /// # Examples
1167- ///
1168- /// ```
1169- /// #![feature(linked_list_extras)]
1170- ///
1171- /// use std::collections::LinkedList;
1172- ///
1173- /// let mut list: LinkedList<_> = vec![1, 2, 3].into_iter().collect();
1174- ///
1175- /// let mut it = list.iter_mut();
1176- /// assert_eq!(it.next().unwrap(), &1);
1177- /// assert_eq!(it.peek_next().unwrap(), &2);
1178- /// // We just peeked at 2, so it was not consumed from the iterator.
1179- /// assert_eq!(it.next().unwrap(), &2);
1180- /// ```
1151+ /// This method will be removed soon.
11811152 #[ inline]
11821153 #[ unstable(
11831154 feature = "linked_list_extras" ,
11841155 reason = "this is probably better handled by a cursor type -- we'll see" ,
11851156 issue = "27794"
11861157 ) ]
1158+ #[ rustc_deprecated(
1159+ reason = "Deprecated in favor of CursorMut methods. This method will be removed soon." ,
1160+ since = "1.47.0"
1161+ ) ]
11871162 pub fn peek_next ( & mut self ) -> Option < & mut T > {
11881163 if self . len == 0 {
11891164 None
0 commit comments