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