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
4 LL | #![feature(specialization)]
7 = note: `#[warn(incomplete_features)]` on by default
8 = note: see issue #31844 <https://github.com/rust-lang/rust/issues/31844> for more information
10 error[E0308]: mismatched types
11 --> $DIR/specialization-default-types.rs:15:9
13 LL | default type Output = Box<T>;
14 | ----------------------------- expected this associated type
15 LL | default fn generate(self) -> Self::Output {
16 | ------------ expected `<T as Example>::Output` because of return type
18 | ^^^^^^^^^^^^^^ expected associated type, found struct `std::boxed::Box`
20 = note: expected associated type `<T as Example>::Output`
21 found struct `std::boxed::Box<T>`
23 error[E0308]: mismatched types
24 --> $DIR/specialization-default-types.rs:25:5
26 LL | fn trouble<T>(t: T) -> Box<T> {
27 | ------ expected `std::boxed::Box<T>` because of return type
28 LL | Example::generate(t)
29 | ^^^^^^^^^^^^^^^^^^^^ expected struct `std::boxed::Box`, found associated type
31 = note: expected struct `std::boxed::Box<T>`
32 found associated type `<T as Example>::Output`
33 = help: consider constraining the associated type `<T as Example>::Output` to `std::boxed::Box<T>`
34 = note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html
36 error: aborting due to 2 previous errors; 1 warning emitted
38 For more information about this error, try `rustc --explain E0308`.