use std::marker; struct A; struct B; struct C; struct Foo(marker::PhantomData<(T,U,V)>); struct Hash(marker::PhantomData); struct HashMap>(marker::PhantomData<(K,V,H)>); fn main() { // Ensure that the printed type doesn't include the default type params... let _: Foo = (); //~^ ERROR mismatched types //~| expected struct `Foo`, found `()` //~| expected struct `Foo` //~| found unit type `()` // ...even when they're present, but the same types as the defaults. let _: Foo = (); //~^ ERROR mismatched types //~| expected struct `Foo`, found `()` //~| expected struct `Foo` //~| found unit type `()` // Including cases where the default is using previous type params. let _: HashMap = (); //~^ ERROR mismatched types //~| expected struct `HashMap`, found `()` //~| expected struct `HashMap` //~| found unit type `()` let _: HashMap> = (); //~^ ERROR mismatched types //~| expected struct `HashMap`, found `()` //~| expected struct `HashMap` //~| found unit type `()` // But not when there's a different type in between. let _: Foo = (); //~^ ERROR mismatched types //~| expected struct `Foo`, found `()` //~| expected struct `Foo` //~| found unit type `()` // And don't print <> at all when there's just defaults. let _: Foo = (); //~^ ERROR mismatched types //~| expected struct `Foo`, found `()` //~| expected struct `Foo` //~| found unit type `()` }