blob: 257c114252cfc1ad131eedafb21c3b9dc2c251a8 [file] [log] [blame]
error[E0308]: mismatched types
--> $DIR/specialization-default-types.rs:15:9
|
LL | default fn generate(self) -> Self::Output {
| ------------ expected `<T as Example>::Output` because of return type
LL | Box::new(self)
| ^^^^^^^^^^^^^^ expected associated type, found struct `std::boxed::Box`
|
= note: expected associated type `<T as Example>::Output`
found struct `std::boxed::Box<T>`
= note: consider constraining the associated type `<T as Example>::Output` to `std::boxed::Box<T>` or calling a method that returns `<T as Example>::Output`
= note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html
error[E0308]: mismatched types
--> $DIR/specialization-default-types.rs:25:5
|
LL | fn trouble<T>(t: T) -> Box<T> {
| ------ expected `std::boxed::Box<T>` because of return type
LL | Example::generate(t)
| ^^^^^^^^^^^^^^^^^^^^ expected struct `std::boxed::Box`, found associated type
|
= note: expected struct `std::boxed::Box<T>`
found associated type `<T as Example>::Output`
= note: consider constraining the associated type `<T as Example>::Output` to `std::boxed::Box<T>`
= note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0308`.