]> git.lizzy.rs Git - rust.git/blob - src/test/ui/infinite/infinite-struct.rs
Rollup merge of #105983 - compiler-errors:issue-105981, r=tmiasko
[rust.git] / src / test / ui / infinite / infinite-struct.rs
1 struct Take(Take);
2 //~^ ERROR has infinite size
3
4 // check that we don't hang trying to find the tail of a recursive struct (#79437)
5 fn foo() -> Take {
6     Take(loop {})
7 }
8
9 // mutually infinite structs
10 struct Foo { //~ ERROR has infinite size
11     x: Bar<Foo>,
12 }
13
14 struct Bar<T>([T; 1]);
15
16 fn main() {}