]> git.lizzy.rs Git - rust.git/blob - tests/ui/traits/cycle-type-trait.rs
Merge commit '598f0909568a51de8a2d1148f55a644fd8dffad0' into sync_cg_clif-2023-01-24
[rust.git] / tests / ui / traits / cycle-type-trait.rs
1 // run-pass
2 #![allow(dead_code)]
3 // Test a case where a supertrait references a type that references
4 // the original trait. This poses no problem at the moment.
5
6 // pretty-expanded FIXME #23616
7
8 trait Chromosome: Get<Struct<i32>> {
9 }
10
11 trait Get<A> {
12     fn get(&self) -> A;
13 }
14
15 struct Struct<C:Chromosome> { c: C }
16
17 impl Chromosome for i32 { }
18
19 impl Get<Struct<i32>> for i32 {
20     fn get(&self) -> Struct<i32> {
21         Struct { c: *self }
22     }
23 }
24
25 fn main() { }