1 // This test checks that genuine type errors with partial
2 // type hints are understandable.
4 use std::marker::PhantomData;
6 struct Foo<T>(PhantomData<T>);
7 struct Bar<U>(PhantomData<U>);
13 let x: Foo<_> = Bar::<usize>(PhantomData);
14 //~^ ERROR mismatched types
15 //~| expected struct `Foo<_>`
16 //~| found struct `Bar<usize>`
17 //~| expected struct `Foo`, found struct `Bar`
18 let y: Foo<usize> = x;
22 let x: Foo<_> = Bar::<usize>(PhantomData);
23 //~^ ERROR mismatched types
24 //~| expected struct `Foo<_>`
25 //~| found struct `Bar<usize>`
26 //~| expected struct `Foo`, found struct `Bar`