summaryrefslogtreecommitdiffstats
path: root/tests/ui/span/recursive-type-field.rs
blob: bd4c435347cfc35c7f0725e545db47407bbe49eb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use std::rc::Rc;

struct Foo<'a> { //~ ERROR recursive types `Foo` and `Bar` have infinite size
    bar: Bar<'a>,
    b: Rc<Bar<'a>>,
}

struct Bar<'a> {
    y: (Foo<'a>, Foo<'a>),
    z: Option<Bar<'a>>,
    a: &'a Foo<'a>,
    c: &'a [Bar<'a>],
    d: [Bar<'a>; 1],
    e: Foo<'a>,
    x: Bar<'a>,
}

fn main() {}