]> git.lizzy.rs Git - rust.git/blob - src/test/ui/specialization/specialization-default-types.stderr
Auto merge of #75936 - sdroege:chunks-exact-construction-bounds-check, r=nagisa
[rust.git] / src / test / 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: `#[warn(incomplete_features)]` on by default
8    = note: see issue #31844 <https://github.com/rust-lang/rust/issues/31844> for more information
9
10 error[E0308]: mismatched types
11   --> $DIR/specialization-default-types.rs:15:9
12    |
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
17 LL |         Box::new(self)
18    |         ^^^^^^^^^^^^^^ expected associated type, found struct `std::boxed::Box`
19    |
20    = note: expected associated type `<T as Example>::Output`
21                        found struct `std::boxed::Box<T>`
22
23 error[E0308]: mismatched types
24   --> $DIR/specialization-default-types.rs:25:5
25    |
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
30    |
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
35
36 error: aborting due to 2 previous errors; 1 warning emitted
37
38 For more information about this error, try `rustc --explain E0308`.