]> git.proxmox.com Git - rustc.git/blob - src/test/ui/issues/issue-28871.rs
New upstream version 1.49.0+dfsg1
[rustc.git] / src / test / ui / issues / issue-28871.rs
1 // check-pass
2 // Regression test for #28871. The problem is that rustc encountered
3 // two ways to project, one from a where clause and one from the where
4 // clauses on the trait definition. (In fact, in this case, the where
5 // clauses originated from the trait definition as well.) The true
6 // cause of the error is that the trait definition where clauses are
7 // not being normalized, and hence the two sources are considered in
8 // conflict, and not a duplicate. Hacky solution is to prefer where
9 // clauses over the data found in the trait definition.
10
11 trait T {
12 type T;
13 }
14
15 struct S;
16 impl T for S {
17 type T = S;
18 }
19
20 trait T2 {
21 type T: Iterator<Item=<S as T>::T>;
22 }
23
24 fn main() { }