summaryrefslogtreecommitdiffstats
path: root/src/test/ui/sized/recursive-type-2.rs
blob: 7d95417a6ffd97ed0deffc8d0788783684e487b6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
// build-fail
//~^ ERROR cycle detected when computing layout of `Foo<()>`

trait A { type Assoc: ?Sized; }

impl A for () {
    type Assoc = Foo<()>;
}
struct Foo<T: A>(T::Assoc);

fn main() {
    let x: Foo<()>;
}