rust/tests/ui/structs-enums/struct-rec/mutual-struct-recursion.rs
2023-01-11 09:32:08 +00:00

22 lines
300 B
Rust

struct A<T> {
//~^ ERROR recursive types `A` and `B` have infinite size
x: T,
y: B<T>,
}
struct B<T> {
z: A<T>
}
struct C<T> {
//~^ ERROR recursive types `C` and `D` have infinite size
x: T,
y: Option<Option<D<T>>>,
}
struct D<T> {
z: Option<Option<C<T>>>,
}
fn main() {}