]> git.lizzy.rs Git - rust.git/blob - tests/ui/specialization/specialization-default-types.stderr
Rollup merge of #106638 - RalfJung:realstd, r=thomcc
[rust.git] / tests / ui / specialization / specialization-default-types.stderr
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: see issue #31844 <https://github.com/rust-lang/rust/issues/31844> for more information
8    = help: consider using `min_specialization` instead, which is more stable and complete
9    = note: `#[warn(incomplete_features)]` on by default
10
11 error[E0308]: mismatched types
12   --> $DIR/specialization-default-types.rs:15:9
13    |
14 LL |     default type Output = Box<T>;
15    |     ----------------------------- expected this associated type
16 LL |     default fn generate(self) -> Self::Output {
17    |                                  ------------ expected `<T as Example>::Output` because of return type
18 LL |         Box::new(self)
19    |         ^^^^^^^^^^^^^^ expected associated type, found struct `Box`
20    |
21    = note: expected associated type `<T as Example>::Output`
22                        found struct `Box<T>`
23
24 error[E0308]: mismatched types
25   --> $DIR/specialization-default-types.rs:25:5
26    |
27 LL | fn trouble<T>(t: T) -> Box<T> {
28    |                        ------ expected `Box<T>` because of return type
29 LL |     Example::generate(t)
30    |     ^^^^^^^^^^^^^^^^^^^^ expected struct `Box`, found associated type
31    |
32    = note:       expected struct `Box<T>`
33            found associated type `<T as Example>::Output`
34    = help: consider constraining the associated type `<T as Example>::Output` to `Box<T>`
35    = note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html
36
37 error: aborting due to 2 previous errors; 1 warning emitted
38
39 For more information about this error, try `rustc --explain E0308`.