]>
Commit | Line | Data |
---|---|---|
b7449926 | 1 | error[E0308]: mismatched types |
0731742a | 2 | --> $DIR/specialization-default-projection.rs:21:5 |
b7449926 XL |
3 | | |
4 | LL | fn generic<T>() -> <T as Foo>::Assoc { | |
5 | | ----------------- expected `<T as Foo>::Assoc` because of return type | |
6 | ... | |
532ac7d7 | 7 | LL | () |
b7449926 XL |
8 | | ^^ expected associated type, found () |
9 | | | |
10 | = note: expected type `<T as Foo>::Assoc` | |
11 | found type `()` | |
e1599b0c XL |
12 | = note: consider constraining the associated type `<T as Foo>::Assoc` to `()` or calling a method that returns `<T as Foo>::Assoc` |
13 | = note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html | |
b7449926 XL |
14 | |
15 | error[E0308]: mismatched types | |
0731742a | 16 | --> $DIR/specialization-default-projection.rs:28:5 |
b7449926 XL |
17 | | |
18 | LL | fn monomorphic() -> () { | |
19 | | -- expected `()` because of return type | |
20 | ... | |
532ac7d7 | 21 | LL | generic::<()>() |
b7449926 XL |
22 | | ^^^^^^^^^^^^^^^- help: try adding a semicolon: `;` |
23 | | | | |
24 | | expected (), found associated type | |
25 | | | |
26 | = note: expected type `()` | |
27 | found type `<() as Foo>::Assoc` | |
e1599b0c XL |
28 | = note: consider constraining the associated type `<() as Foo>::Assoc` to `()` |
29 | = note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html | |
b7449926 XL |
30 | |
31 | error: aborting due to 2 previous errors | |
32 | ||
33 | For more information about this error, try `rustc --explain E0308`. |