6 struct Foo<T = A, U = B, V = C>(marker::PhantomData<(T,U,V)>);
8 struct Hash<T>(marker::PhantomData<T>);
9 struct HashMap<K, V, H = Hash<K>>(marker::PhantomData<(K,V,H)>);
12 // Ensure that the printed type doesn't include the default type params...
13 let _: Foo<isize> = ();
14 //~^ ERROR mismatched types
15 //~| expected struct `Foo`, found `()`
16 //~| expected struct `Foo<isize>`
17 //~| found unit type `()`
19 // ...even when they're present, but the same types as the defaults.
20 let _: Foo<isize, B, C> = ();
21 //~^ ERROR mismatched types
22 //~| expected struct `Foo`, found `()`
23 //~| expected struct `Foo<isize>`
24 //~| found unit type `()`
26 // Including cases where the default is using previous type params.
27 let _: HashMap<String, isize> = ();
28 //~^ ERROR mismatched types
29 //~| expected struct `HashMap`, found `()`
30 //~| expected struct `HashMap<String, isize>`
31 //~| found unit type `()`
32 let _: HashMap<String, isize, Hash<String>> = ();
33 //~^ ERROR mismatched types
34 //~| expected struct `HashMap`, found `()`
35 //~| expected struct `HashMap<String, isize>`
36 //~| found unit type `()`
38 // But not when there's a different type in between.
39 let _: Foo<A, isize, C> = ();
40 //~^ ERROR mismatched types
41 //~| expected struct `Foo`, found `()`
42 //~| expected struct `Foo<A, isize>`
43 //~| found unit type `()`
45 // And don't print <> at all when there's just defaults.
46 let _: Foo<A, B, C> = ();
47 //~^ ERROR mismatched types
48 //~| expected struct `Foo`, found `()`
49 //~| expected struct `Foo`
50 //~| found unit type `()`