error[E0282]: type annotations needed in `B` --> $DIR/issue-17551.rs:6:15 | LL | let foo = B(marker::PhantomData); | --- ^ cannot infer type for `T` in `B` | | | consider giving `foo` the type `B` with the type parameter `T` specified error: aborting due to previous error For more information about this error, try `rustc --explain E0282`.