]> git.lizzy.rs Git - rust.git/blob - src/test/ui/sized-cycle-note.rs
parser will not give wrong help message for 'public'
[rust.git] / src / test / ui / sized-cycle-note.rs
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
14 impl Foo { fn bar(&self) {} }
15
16 fn main() {}