use std::marker; struct B(marker::PhantomData); fn main() { let foo = B(marker::PhantomData); //~ ERROR type annotations needed let closure = || foo; }