]> git.proxmox.com Git - rustc.git/blame - src/test/compile-fail/trait-bounds-impl-comparison-2.rs
Imported Upstream version 1.9.0+dfsg1
[rustc.git] / src / test / compile-fail / trait-bounds-impl-comparison-2.rs
CommitLineData
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
13trait Iterator<A> {
14 fn next(&mut self) -> Option<A>;
15}
16
9cc50fc6 17trait IteratorUtil<A>: Sized
85aaf69f 18{
1a4d82fc
JJ
19 fn zip<B, U: Iterator<U>>(self, other: U) -> ZipIterator<Self, U>;
20}
21
22impl<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
29struct ZipIterator<T, U> {
30 a: T, b: U
31}
32
33fn main() {}