use std::marker; struct Foo { foo: Bar } struct Bar { x: Bar , marker: marker::PhantomData } //~^ ERROR recursive type `Bar` has infinite size impl Foo { fn foo(&self) {} } fn main() { }