]> git.lizzy.rs Git - rust.git/blob - src/test/ui/compare-method/traits-misc-mismatch-2.rs
Rollup merge of #99578 - steffahn:remove_redundant_bound, r=thomcc
[rust.git] / src / test / ui / compare-method / traits-misc-mismatch-2.rs
1 // Issue #5886: a complex instance of issue #2687.
2
3 trait Iterator<A> {
4     fn next(&mut self) -> Option<A>;
5 }
6
7 trait IteratorUtil<A>: Sized
8 {
9     fn zip<B, U: Iterator<U>>(self, other: U) -> ZipIterator<Self, U>;
10 }
11
12 impl<A, T: Iterator<A>> IteratorUtil<A> for T {
13     fn zip<B, U: Iterator<B>>(self, other: U) -> ZipIterator<T, U> {
14     //~^ ERROR E0276
15         ZipIterator{a: self, b: other}
16     }
17 }
18
19 struct ZipIterator<T, U> {
20     a: T, b: U
21 }
22
23 fn main() {}