]>
Commit | Line | Data |
---|---|---|
f035d41b XL |
1 | warning: the feature `specialization` is incomplete and may not be safe to use and/or cause compiler crashes |
2 | --> $DIR/specialization-default-types.rs:5:12 | |
3 | | | |
4 | LL | #![feature(specialization)] | |
5 | | ^^^^^^^^^^^^^^ | |
6 | | | |
7 | = note: `#[warn(incomplete_features)]` on by default | |
8 | = note: see issue #31844 <https://github.com/rust-lang/rust/issues/31844> for more information | |
29967ef6 | 9 | = help: consider using `min_specialization` instead, which is more stable and complete |
f035d41b | 10 | |
b7449926 | 11 | error[E0308]: mismatched types |
0731742a | 12 | --> $DIR/specialization-default-types.rs:15:9 |
b7449926 | 13 | | |
f9f354fc XL |
14 | LL | default type Output = Box<T>; |
15 | | ----------------------------- expected this associated type | |
b7449926 XL |
16 | LL | default fn generate(self) -> Self::Output { |
17 | | ------------ expected `<T as Example>::Output` because of return type | |
532ac7d7 | 18 | LL | Box::new(self) |
1b1a35ee | 19 | | ^^^^^^^^^^^^^^ expected associated type, found struct `Box` |
b7449926 | 20 | | |
60c5eb7d | 21 | = note: expected associated type `<T as Example>::Output` |
1b1a35ee | 22 | found struct `Box<T>` |
b7449926 XL |
23 | |
24 | error[E0308]: mismatched types | |
0731742a | 25 | --> $DIR/specialization-default-types.rs:25:5 |
b7449926 XL |
26 | | |
27 | LL | fn trouble<T>(t: T) -> Box<T> { | |
1b1a35ee | 28 | | ------ expected `Box<T>` because of return type |
532ac7d7 | 29 | LL | Example::generate(t) |
1b1a35ee | 30 | | ^^^^^^^^^^^^^^^^^^^^ expected struct `Box`, found associated type |
b7449926 | 31 | | |
1b1a35ee | 32 | = note: expected struct `Box<T>` |
60c5eb7d | 33 | found associated type `<T as Example>::Output` |
1b1a35ee | 34 | = help: consider constraining the associated type `<T as Example>::Output` to `Box<T>` |
e1599b0c | 35 | = note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html |
b7449926 | 36 | |
f035d41b | 37 | error: aborting due to 2 previous errors; 1 warning emitted |
b7449926 XL |
38 | |
39 | For more information about this error, try `rustc --explain E0308`. |