]>
Commit | Line | Data |
---|---|---|
1a4d82fc JJ |
1 | // Copyright 2014 The Rust Project Developers. See the COPYRIGHT |
2 | // file at the top-level directory of this distribution and at | |
3 | // http://rust-lang.org/COPYRIGHT. | |
4 | // | |
5 | // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or | |
6 | // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license | |
7 | // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your | |
8 | // option. This file may not be copied, modified, or distributed | |
9 | // except according to those terms. | |
10 | ||
11 | // Issue #5886: a complex instance of issue #2687. | |
12 | ||
13 | trait Iterator<A> { | |
14 | fn next(&mut self) -> Option<A>; | |
15 | } | |
16 | ||
9cc50fc6 | 17 | trait IteratorUtil<A>: Sized |
85aaf69f | 18 | { |
1a4d82fc JJ |
19 | fn zip<B, U: Iterator<U>>(self, other: U) -> ZipIterator<Self, U>; |
20 | } | |
21 | ||
22 | impl<A, T: Iterator<A>> IteratorUtil<A> for T { | |
23 | fn zip<B, U: Iterator<B>>(self, other: U) -> ZipIterator<T, U> { | |
54a0048b | 24 | //~^ ERROR the requirement `U: Iterator<B>` appears on the impl method |
1a4d82fc JJ |
25 | ZipIterator{a: self, b: other} |
26 | } | |
27 | } | |
28 | ||
29 | struct ZipIterator<T, U> { | |
30 | a: T, b: U | |
31 | } | |
32 | ||
33 | fn main() {} |