mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-24 15:54:15 +00:00
22 lines
300 B
Rust
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() {}
|