Skip to content

Commit 0ee95b9

Browse files
committed
std: Mark IntoIterator::into_iter as #[stable
Right now it is not possible to write a `for` loop without opting-in to the `core` feature due to the way they're expanding (calling `::std::iter::IntoIterator::into_iter`). There are some planned tweaks to the `IntoIterator` trait (adding an `Item` associated type) which will cause implementations of `IntoIterator` to break, but the *usage* of the trait is currently stable. This commit marks the method `into_iter` as stable as the name will not be changing, nor the fact that it takes no arguments and returns one type (which is determiend by the `Self` type). This means that usage of `for` loops is now stable but manual implementations of the `IntoIterator` trait will continue to be unstable.
1 parent 605225a commit 0ee95b9

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/libcore/iter.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ pub trait IntoIterator {
123123
type IntoIter: Iterator;
124124

125125
/// Consumes `Self` and returns an iterator over it
126+
#[stable(feature = "rust1", since = "1.0.0")]
126127
fn into_iter(self) -> Self::IntoIter;
127128
}
128129

0 commit comments

Comments
 (0)