This compiles
struct Foo<T> {
y: T,
x: Option<*const Foo<(T,)>>,
}
fn main() {
let x = Foo {
y: 1u32,
x: None,
};
}
It feels quite brittle however, e.g. the following does not:
struct Foo<T> {
y: T,
// We recur due to drop checking
x: Option<Box<Foo<(T,)>>>,
}
fn main() {
let x = Foo {
y: 1u32,
x: None,
};
}
This compiles
It feels quite brittle however, e.g. the following does not: