]> git.proxmox.com Git - rustc.git/blame - src/test/ui/specialization/specialization-default-types.stderr
New upstream version 1.49.0~beta.4+dfsg1
[rustc.git] / src / test / ui / specialization / specialization-default-types.stderr
CommitLineData
f035d41b
XL
1warning: 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 |
4LL | #![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 11error[E0308]: mismatched types
0731742a 12 --> $DIR/specialization-default-types.rs:15:9
b7449926 13 |
f9f354fc
XL
14LL | default type Output = Box<T>;
15 | ----------------------------- expected this associated type
b7449926
XL
16LL | default fn generate(self) -> Self::Output {
17 | ------------ expected `<T as Example>::Output` because of return type
532ac7d7 18LL | 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
24error[E0308]: mismatched types
0731742a 25 --> $DIR/specialization-default-types.rs:25:5
b7449926
XL
26 |
27LL | fn trouble<T>(t: T) -> Box<T> {
1b1a35ee 28 | ------ expected `Box<T>` because of return type
532ac7d7 29LL | 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 37error: aborting due to 2 previous errors; 1 warning emitted
b7449926
XL
38
39For more information about this error, try `rustc --explain E0308`.