Manish Goregaokar d264ef2b11 Rollup merge of #22313 - japaric:iter, r=aturon
`IntoIterator` now has an extra associated item:

``` rust
trait IntoIterator {
    type Item;
    type IntoIter: Iterator<Self=Self::Item>;
}
```

This lets you bind the iterator \"`Item`\" directly when writing generic functions:

``` rust
// hypothetical change, not included in this PR
impl Extend<T> for Vec<T> {
    // you can now write
    fn extend<I>(&mut self, it: I) where I: IntoIterator<Item=T> { .. }
    // instead of
    fn extend<I: IntoIterator>(&mut self, it: I) where I::IntoIter: Iterator<Item=T> { .. }
}
```

The downside is that now you have to write an extra associated type in your `IntoIterator` implementations:

``` diff
 impl<T> IntoIterator for Vec<T> {
+    type Item = T;
     type IntoIter = IntoIter<T>;

     fn into_iter(self) -> IntoIter<T> { .. }
 }
```

Because this breaks all downstream implementations of `IntoIterator`, this is a [breaking-change]

---

r? @aturon
2015-02-17 06:23:40 +05:30
..
2015-02-15 00:10:19 +03:00
2015-02-08 20:00:30 +03:00
2015-01-29 07:49:02 -05:00
2015-02-03 14:34:42 -08:00
2015-02-15 10:25:13 -05:00
2015-02-15 19:26:39 +05:30
2015-02-11 13:51:09 +01:00
2015-02-15 10:22:43 -05:00
2015-02-02 13:38:32 -05:00
2015-02-13 14:30:31 -05:00
2015-02-15 10:24:47 -05:00
2015-01-29 07:49:02 -05:00
2015-02-09 22:26:33 -05:00