]> git.lizzy.rs Git - rust.git/blob - tests/ui/structs/struct-path-self-type-mismatch.stderr
Auto merge of #106503 - cjgillot:remap-nofilter, r=oli-obk
[rust.git] / tests / ui / structs / struct-path-self-type-mismatch.stderr
1 error[E0308]: mismatched types
2   --> $DIR/struct-path-self-type-mismatch.rs:7:23
3    |
4 LL |         Self { inner: 1.5f32 };
5    |                       ^^^^^^ expected `i32`, found `f32`
6
7 error[E0308]: mismatched types
8   --> $DIR/struct-path-self-type-mismatch.rs:15:20
9    |
10 LL | impl<T> Foo<T> {
11    |      - expected type parameter
12 LL |     fn new<U>(u: U) -> Foo<U> {
13    |            - found type parameter
14 ...
15 LL |             inner: u
16    |                    ^ expected type parameter `T`, found type parameter `U`
17    |
18    = note: expected type parameter `T`
19               found type parameter `U`
20    = note: a type parameter was expected, but a different one was found; you might be missing a type parameter or trait bound
21    = note: for more information, visit https://doc.rust-lang.org/book/ch10-02-traits.html#traits-as-parameters
22
23 error[E0308]: mismatched types
24   --> $DIR/struct-path-self-type-mismatch.rs:13:9
25    |
26 LL |   impl<T> Foo<T> {
27    |        - found type parameter
28 LL |       fn new<U>(u: U) -> Foo<U> {
29    |              -           ------ expected `Foo<U>` because of return type
30    |              |
31    |              expected type parameter
32 LL | /         Self {
33 LL | |
34 LL | |             inner: u
35 LL | |
36 LL | |         }
37    | |_________^ expected type parameter `U`, found type parameter `T`
38    |
39    = note: expected struct `Foo<U>`
40               found struct `Foo<T>`
41    = note: a type parameter was expected, but a different one was found; you might be missing a type parameter or trait bound
42    = note: for more information, visit https://doc.rust-lang.org/book/ch10-02-traits.html#traits-as-parameters
43
44 error: aborting due to 3 previous errors
45
46 For more information about this error, try `rustc --explain E0308`.