1 warning: the feature `specialization` is incomplete and may not be safe to use and/or cause compiler crashes
2 --> $DIR/defaults-specialization.rs:3:38
4 LL | #![feature(associated_type_defaults, 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
9 = help: consider using `min_specialization` instead, which is more stable and complete
11 error[E0053]: method `make` has an incompatible type for trait
12 --> $DIR/defaults-specialization.rs:19:18
14 LL | fn make() -> Self::Ty {
15 | -------- type in trait
17 LL | fn make() -> u8 { 0 }
18 | ^^ expected associated type, found `u8`
20 = note: expected fn pointer `fn() -> <A<T> as Tr>::Ty`
21 found fn pointer `fn() -> u8`
23 error[E0053]: method `make` has an incompatible type for trait
24 --> $DIR/defaults-specialization.rs:35:18
26 LL | fn make() -> Self::Ty {
27 | -------- type in trait
29 LL | default type Ty = bool;
30 | ----------------------- expected this associated type
32 LL | fn make() -> bool { true }
33 | ^^^^ expected associated type, found `bool`
35 = note: expected fn pointer `fn() -> <B<T> as Tr>::Ty`
36 found fn pointer `fn() -> bool`
38 error[E0308]: mismatched types
39 --> $DIR/defaults-specialization.rs:10:9
42 | ------------- associated type defaults can't be assumed inside the trait defining them
44 LL | fn make() -> Self::Ty {
45 | -------- expected `<Self as Tr>::Ty` because of return type
47 | ^^^ expected associated type, found `u8`
49 = note: expected associated type `<Self as Tr>::Ty`
52 error[E0308]: mismatched types
53 --> $DIR/defaults-specialization.rs:26:29
55 LL | fn make() -> Self::Ty { 0u8 }
56 | -------- ^^^ expected associated type, found `u8`
58 | expected `<A2<T> as Tr>::Ty` because of return type
60 = note: expected associated type `<A2<T> as Tr>::Ty`
62 = help: consider constraining the associated type `<A2<T> as Tr>::Ty` to `u8` or calling a method that returns `<A2<T> as Tr>::Ty`
63 = note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html
65 error[E0308]: mismatched types
66 --> $DIR/defaults-specialization.rs:44:29
68 LL | default type Ty = bool;
69 | ----------------------- expected this associated type
71 LL | fn make() -> Self::Ty { true }
72 | -------- ^^^^ expected associated type, found `bool`
74 | expected `<B2<T> as Tr>::Ty` because of return type
76 = note: expected associated type `<B2<T> as Tr>::Ty`
79 error[E0308]: mismatched types
80 --> $DIR/defaults-specialization.rs:87:32
82 LL | let _: <B<()> as Tr>::Ty = 0u8;
83 | ----------------- ^^^ expected associated type, found `u8`
85 | expected due to this
87 = note: expected associated type `<B<()> as Tr>::Ty`
89 help: a method is available that returns `<B<()> as Tr>::Ty`
90 --> $DIR/defaults-specialization.rs:9:5
92 LL | fn make() -> Self::Ty {
93 | ^^^^^^^^^^^^^^^^^^^^^ consider calling `Tr::make`
95 error[E0308]: mismatched types
96 --> $DIR/defaults-specialization.rs:88:32
98 LL | let _: <B<()> as Tr>::Ty = true;
99 | ----------------- ^^^^ expected associated type, found `bool`
101 | expected due to this
103 = note: expected associated type `<B<()> as Tr>::Ty`
105 help: a method is available that returns `<B<()> as Tr>::Ty`
106 --> $DIR/defaults-specialization.rs:9:5
108 LL | fn make() -> Self::Ty {
109 | ^^^^^^^^^^^^^^^^^^^^^ consider calling `Tr::make`
111 error[E0308]: mismatched types
112 --> $DIR/defaults-specialization.rs:89:33
114 LL | let _: <B2<()> as Tr>::Ty = 0u8;
115 | ------------------ ^^^ expected associated type, found `u8`
117 | expected due to this
119 = note: expected associated type `<B2<()> as Tr>::Ty`
121 help: a method is available that returns `<B2<()> as Tr>::Ty`
122 --> $DIR/defaults-specialization.rs:9:5
124 LL | fn make() -> Self::Ty {
125 | ^^^^^^^^^^^^^^^^^^^^^ consider calling `Tr::make`
127 error[E0308]: mismatched types
128 --> $DIR/defaults-specialization.rs:90:33
130 LL | let _: <B2<()> as Tr>::Ty = true;
131 | ------------------ ^^^^ expected associated type, found `bool`
133 | expected due to this
135 = note: expected associated type `<B2<()> as Tr>::Ty`
137 help: a method is available that returns `<B2<()> as Tr>::Ty`
138 --> $DIR/defaults-specialization.rs:9:5
140 LL | fn make() -> Self::Ty {
141 | ^^^^^^^^^^^^^^^^^^^^^ consider calling `Tr::make`
143 error: aborting due to 9 previous errors; 1 warning emitted
145 Some errors have detailed explanations: E0053, E0308.
146 For more information about an error, try `rustc --explain E0053`.