about summary refs log tree commit diff
path: root/tests/ui/infinite/infinite-struct.rs
blob: d784455824604f844537a34e081cd950fb404ee1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
struct Take(Take);
//~^ ERROR has infinite size
//~| ERROR cycle
//~| ERROR reached the recursion limit finding the struct tail for `Take`

// check that we don't hang trying to find the tail of a recursive struct (#79437)
fn foo() -> Take {
    Take(loop {})
}

// mutually infinite structs
struct Foo { //~ ERROR has infinite size
    x: Bar<Foo>,
}

struct Bar<T>([T; 1]);

fn main() {}