rust/tests/ui/sized/recursive-type-binding.rs

14 lines
217 B
Rust

//@ 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<()>;
}