Skip to content

Commit d031a44

Browse files
committed
Stabilize Iterator::intersperse
1 parent 6c20ab7 commit d031a44

File tree

11 files changed

+10
-25
lines changed

11 files changed

+10
-25
lines changed

compiler/rustc_codegen_llvm/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
#![feature(let_else)]
1111
#![feature(extern_types)]
1212
#![feature(once_cell)]
13-
#![feature(iter_intersperse)]
1413
#![recursion_limit = "256"]
1514
#![allow(rustc::potential_query_instability)]
1615

compiler/rustc_lint/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
#![feature(box_patterns)]
3232
#![feature(control_flow_enum)]
3333
#![feature(if_let_guard)]
34-
#![feature(iter_intersperse)]
3534
#![feature(iter_order_by)]
3635
#![feature(let_chains)]
3736
#![feature(let_else)]

compiler/rustc_passes/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
77
#![allow(rustc::potential_query_instability)]
88
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
9-
#![feature(iter_intersperse)]
109
#![feature(let_else)]
1110
#![feature(let_chains)]
1211
#![feature(map_try_insert)]

compiler/rustc_typeck/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ This API is completely unstable and subject to change.
6363
#![feature(hash_drain_filter)]
6464
#![feature(if_let_guard)]
6565
#![feature(is_sorted)]
66-
#![feature(iter_intersperse)]
6766
#![feature(label_break_value)]
6867
#![feature(let_chains)]
6968
#![feature(let_else)]

library/core/src/iter/adapters/intersperse.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use super::Peekable;
44
///
55
/// This `struct` is created by [`Iterator::intersperse`]. See its documentation
66
/// for more information.
7-
#[unstable(feature = "iter_intersperse", reason = "recently added", issue = "79524")]
7+
#[stable(feature = "iter_intersperse", since = "1.64.0")]
88
#[derive(Debug, Clone)]
99
pub struct Intersperse<I: Iterator>
1010
where
@@ -24,7 +24,7 @@ where
2424
}
2525
}
2626

27-
#[unstable(feature = "iter_intersperse", reason = "recently added", issue = "79524")]
27+
#[stable(feature = "iter_intersperse", since = "1.64.0")]
2828
impl<I> Iterator for Intersperse<I>
2929
where
3030
I: Iterator,
@@ -61,7 +61,7 @@ where
6161
///
6262
/// This `struct` is created by [`Iterator::intersperse_with`]. See its
6363
/// documentation for more information.
64-
#[unstable(feature = "iter_intersperse", reason = "recently added", issue = "79524")]
64+
#[stable(feature = "iter_intersperse", since = "1.64.0")]
6565
pub struct IntersperseWith<I, G>
6666
where
6767
I: Iterator,
@@ -71,7 +71,7 @@ where
7171
needs_sep: bool,
7272
}
7373

74-
#[unstable(feature = "iter_intersperse", reason = "recently added", issue = "79524")]
74+
#[stable(feature = "iter_intersperse", since = "1.64.0")]
7575
impl<I, G> crate::fmt::Debug for IntersperseWith<I, G>
7676
where
7777
I: Iterator + crate::fmt::Debug,
@@ -87,7 +87,7 @@ where
8787
}
8888
}
8989

90-
#[unstable(feature = "iter_intersperse", reason = "recently added", issue = "79524")]
90+
#[stable(feature = "iter_intersperse", since = "1.64.0")]
9191
impl<I, G> crate::clone::Clone for IntersperseWith<I, G>
9292
where
9393
I: Iterator + crate::clone::Clone,
@@ -113,7 +113,7 @@ where
113113
}
114114
}
115115

116-
#[unstable(feature = "iter_intersperse", reason = "recently added", issue = "79524")]
116+
#[stable(feature = "iter_intersperse", since = "1.64.0")]
117117
impl<I, G> Iterator for IntersperseWith<I, G>
118118
where
119119
I: Iterator,

library/core/src/iter/adapters/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ pub use self::flatten::Flatten;
4747
#[stable(feature = "iter_copied", since = "1.36.0")]
4848
pub use self::copied::Copied;
4949

50-
#[unstable(feature = "iter_intersperse", reason = "recently added", issue = "79524")]
50+
#[stable(feature = "iter_intersperse", since = "1.64.0")]
5151
pub use self::intersperse::{Intersperse, IntersperseWith};
5252

5353
#[stable(feature = "iter_map_while", since = "1.57.0")]

library/core/src/iter/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ pub use self::adapters::{
421421
Chain, Cycle, Enumerate, Filter, FilterMap, FlatMap, Fuse, Inspect, Map, Peekable, Rev, Scan,
422422
Skip, SkipWhile, Take, TakeWhile, Zip,
423423
};
424-
#[unstable(feature = "iter_intersperse", reason = "recently added", issue = "79524")]
424+
#[stable(feature = "iter_intersperse", since = "1.64.0")]
425425
pub use self::adapters::{Intersperse, IntersperseWith};
426426

427427
pub(crate) use self::adapters::try_process;

library/core/src/iter/traits/iterator.rs

+2-10
Original file line numberDiff line numberDiff line change
@@ -633,8 +633,6 @@ pub trait Iterator {
633633
/// Basic usage:
634634
///
635635
/// ```
636-
/// #![feature(iter_intersperse)]
637-
///
638636
/// let mut a = [0, 1, 2].iter().intersperse(&100);
639637
/// assert_eq!(a.next(), Some(&0)); // The first element from `a`.
640638
/// assert_eq!(a.next(), Some(&100)); // The separator.
@@ -646,16 +644,14 @@ pub trait Iterator {
646644
///
647645
/// `intersperse` can be very useful to join an iterator's items using a common element:
648646
/// ```
649-
/// #![feature(iter_intersperse)]
650-
///
651647
/// let hello = ["Hello", "World", "!"].iter().copied().intersperse(" ").collect::<String>();
652648
/// assert_eq!(hello, "Hello World !");
653649
/// ```
654650
///
655651
/// [`Clone`]: crate::clone::Clone
656652
/// [`intersperse_with`]: Iterator::intersperse_with
657653
#[inline]
658-
#[unstable(feature = "iter_intersperse", reason = "recently added", issue = "79524")]
654+
#[stable(feature = "iter_intersperse", since = "1.64.0")]
659655
fn intersperse(self, separator: Self::Item) -> Intersperse<Self>
660656
where
661657
Self: Sized,
@@ -680,8 +676,6 @@ pub trait Iterator {
680676
/// Basic usage:
681677
///
682678
/// ```
683-
/// #![feature(iter_intersperse)]
684-
///
685679
/// #[derive(PartialEq, Debug)]
686680
/// struct NotClone(usize);
687681
///
@@ -699,8 +693,6 @@ pub trait Iterator {
699693
/// `intersperse_with` can be used in situations where the separator needs
700694
/// to be computed:
701695
/// ```
702-
/// #![feature(iter_intersperse)]
703-
///
704696
/// let src = ["Hello", "to", "all", "people", "!!"].iter().copied();
705697
///
706698
/// // The closure mutably borrows its context to generate an item.
@@ -713,7 +705,7 @@ pub trait Iterator {
713705
/// [`Clone`]: crate::clone::Clone
714706
/// [`intersperse`]: Iterator::intersperse
715707
#[inline]
716-
#[unstable(feature = "iter_intersperse", reason = "recently added", issue = "79524")]
708+
#[stable(feature = "iter_intersperse", since = "1.64.0")]
717709
fn intersperse_with<G>(self, separator: G) -> IntersperseWith<Self, G>
718710
where
719711
Self: Sized,

library/core/tests/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@
6565
#![feature(iter_advance_by)]
6666
#![feature(iter_collect_into)]
6767
#![feature(iter_partition_in_place)]
68-
#![feature(iter_intersperse)]
6968
#![feature(iter_is_partitioned)]
7069
#![feature(iter_next_chunk)]
7170
#![feature(iter_order_by)]

src/librustdoc/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
#![feature(never_type)]
1616
#![feature(once_cell)]
1717
#![feature(type_ascription)]
18-
#![feature(iter_intersperse)]
1918
#![feature(type_alias_impl_trait)]
2019
#![feature(generic_associated_types)]
2120
#![recursion_limit = "256"]

src/tools/clippy/clippy_lints/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
#![feature(box_patterns)]
44
#![feature(control_flow_enum)]
55
#![feature(drain_filter)]
6-
#![feature(iter_intersperse)]
76
#![feature(let_chains)]
87
#![feature(let_else)]
98
#![feature(lint_reasons)]

0 commit comments

Comments
 (0)