Skip to content

Commit 7bbe4b2

Browse files
committed
constify Iterator
1 parent 0c3c8d2 commit 7bbe4b2

File tree

5 files changed

+103
-7
lines changed

5 files changed

+103
-7
lines changed

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,8 @@ pub trait FromIterator<A>: Sized {
279279
)]
280280
#[rustc_skip_during_method_dispatch(array, boxed_slice)]
281281
#[stable(feature = "rust1", since = "1.0.0")]
282-
pub trait IntoIterator {
282+
#[rustc_const_unstable(feature = "const_iter", issue = "92476")]
283+
pub const trait IntoIterator {
283284
/// The type of the elements being iterated over.
284285
#[stable(feature = "rust1", since = "1.0.0")]
285286
type Item;
@@ -311,7 +312,8 @@ pub trait IntoIterator {
311312
}
312313

313314
#[stable(feature = "rust1", since = "1.0.0")]
314-
impl<I: Iterator> IntoIterator for I {
315+
#[rustc_const_unstable(feature = "const_iter", issue = "92476")]
316+
impl<I: [const] Iterator> const IntoIterator for I {
315317
type Item = I::Item;
316318
type IntoIter = I;
317319

0 commit comments

Comments
 (0)