rust/tests/ui/infinite/infinite-struct.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

18 lines
316 B
Rust
Raw Normal View History

struct Take(Take);
//~^ ERROR has infinite size
//~| ERROR cycle
// check that we don't hang trying to find the tail of a recursive struct (#79437)
fn foo() -> Take {
Take(loop {})
}
2022-08-15 19:11:11 +00:00
// mutually infinite structs
struct Foo { //~ ERROR has infinite size
x: Bar<Foo>,
}
struct Bar<T>([T; 1]);
fn main() {}