1 // Test the error message resulting from a cycle in solving `Foo:
2 // Sized`. The specifics of the message will of course but the main
3 // thing we want to preserve is that:
4 //
5 // 1. the message should appear attached to one of the structs
6 //    defined in this file;
7 // 2. it should elaborate the steps that led to the cycle.
8 
9 struct Baz { q: Option<Foo> }
10 //~^ ERROR recursive type `Baz` has infinite size
11 struct Foo { q: Option<Baz> }
12 //~^ ERROR recursive type `Foo` has infinite size
13 
bar(&self)14 impl Foo { fn bar(&self) {} }
15 
main()16 fn main() {}
17