summaryrefslogtreecommitdiffstats
path: root/tests/ui/traits/cycle-type-trait.rs
blob: c62d01403c7f86a88a1f79deb37939ae7072369a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// run-pass
#![allow(dead_code)]
// Test a case where a supertrait references a type that references
// the original trait. This poses no problem at the moment.

// pretty-expanded FIXME #23616

trait Chromosome: Get<Struct<i32>> {
}

trait Get<A> {
    fn get(&self) -> A;
}

struct Struct<C:Chromosome> { c: C }

impl Chromosome for i32 { }

impl Get<Struct<i32>> for i32 {
    fn get(&self) -> Struct<i32> {
        Struct { c: *self }
    }
}

fn main() { }