]> git.lizzy.rs Git - rust.git/blob - src/test/run-pass/issue-28871.rs
add main fn to test
[rust.git] / src / test / run-pass / issue-28871.rs
1 // Copyright 2015 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 // Regression test for #28871. The problem is that rustc encountered
12 // two ways to project, one from a where clause and one from the where
13 // clauses on the trait definition. (In fact, in this case, the where
14 // clauses originated from the trait definition as well.) The true
15 // cause of the error is that the trait definition where clauses are
16 // not being normalized, and hence the two sources are considered in
17 // conflict, and not a duplicate. Hacky solution is to prefer where
18 // clauses over the data found in the trait definition.
19
20 trait T {
21     type T;
22 }
23
24 struct S;
25 impl T for S {
26     type T = S;
27 }
28
29 trait T2 {
30     type T: Iterator<Item=<S as T>::T>;
31 }
32
33 fn main() { }