]> git.lizzy.rs Git - rust.git/blob - tests/ui/structs/struct-path-self-type-mismatch.rs
Rollup merge of #106793 - Mark-Simulacrum:normalize-test, r=compiler-errors
[rust.git] / tests / ui / structs / struct-path-self-type-mismatch.rs
1 struct Foo<A> { inner: A }
2
3 trait Bar { fn bar(); }
4
5 impl Bar for Foo<i32> {
6     fn bar() {
7         Self { inner: 1.5f32 }; //~ ERROR mismatched types
8     }
9 }
10
11 impl<T> Foo<T> {
12     fn new<U>(u: U) -> Foo<U> {
13         Self {
14         //~^ ERROR mismatched types
15             inner: u
16             //~^ ERROR mismatched types
17         }
18     }
19 }
20
21 fn main() {}