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: 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
11 error[E0053]: method `make` has an incompatible type for trait
12 --> $DIR/defaults-specialization.rs:19:18
14 LL | fn make() -> u8 { 0 }
17 | expected associated type, found `u8`
18 | help: change the output type to match the trait: `<A<T> as Tr>::Ty`
21 --> $DIR/defaults-specialization.rs:9:18
23 LL | fn make() -> Self::Ty {
25 = note: expected signature `fn() -> <A<T> as Tr>::Ty`
26 found signature `fn() -> u8`
28 error[E0053]: method `make` has an incompatible type for trait
29 --> $DIR/defaults-specialization.rs:35:18
31 LL | default type Ty = bool;
32 | ----------------------- expected this associated type
34 LL | fn make() -> bool { true }
37 | expected associated type, found `bool`
38 | help: change the output type to match the trait: `<B<T> as Tr>::Ty`
41 --> $DIR/defaults-specialization.rs:9:18
43 LL | fn make() -> Self::Ty {
45 = note: expected signature `fn() -> <B<T> as Tr>::Ty`
46 found signature `fn() -> bool`
48 error[E0308]: mismatched types
49 --> $DIR/defaults-specialization.rs:10:9
52 | ------------- associated type defaults can't be assumed inside the trait defining them
54 LL | fn make() -> Self::Ty {
55 | -------- expected `<Self as Tr>::Ty` because of return type
57 | ^^^ expected associated type, found `u8`
59 = note: expected associated type `<Self as Tr>::Ty`
62 error[E0308]: mismatched types
63 --> $DIR/defaults-specialization.rs:26:29
65 LL | fn make() -> Self::Ty { 0u8 }
66 | -------- ^^^ expected associated type, found `u8`
68 | expected `<A2<T> as Tr>::Ty` because of return type
70 = note: expected associated type `<A2<T> as Tr>::Ty`
72 = help: consider constraining the associated type `<A2<T> as Tr>::Ty` to `u8` or calling a method that returns `<A2<T> as Tr>::Ty`
73 = note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html
75 error[E0308]: mismatched types
76 --> $DIR/defaults-specialization.rs:44:29
78 LL | default type Ty = bool;
79 | ----------------------- expected this associated type
81 LL | fn make() -> Self::Ty { true }
82 | -------- ^^^^ expected associated type, found `bool`
84 | expected `<B2<T> as Tr>::Ty` because of return type
86 = note: expected associated type `<B2<T> as Tr>::Ty`
89 error[E0308]: mismatched types
90 --> $DIR/defaults-specialization.rs:87:32
92 LL | let _: <B<()> as Tr>::Ty = 0u8;
93 | ----------------- ^^^ expected associated type, found `u8`
95 | expected due to this
97 = note: expected associated type `<B<()> as Tr>::Ty`
99 help: a method is available that returns `<B<()> as Tr>::Ty`
100 --> $DIR/defaults-specialization.rs:9:5
102 LL | fn make() -> Self::Ty {
103 | ^^^^^^^^^^^^^^^^^^^^^ consider calling `Tr::make`
105 error[E0308]: mismatched types
106 --> $DIR/defaults-specialization.rs:88:32
108 LL | let _: <B<()> as Tr>::Ty = true;
109 | ----------------- ^^^^ expected associated type, found `bool`
111 | expected due to this
113 = note: expected associated type `<B<()> as Tr>::Ty`
115 help: a method is available that returns `<B<()> as Tr>::Ty`
116 --> $DIR/defaults-specialization.rs:9:5
118 LL | fn make() -> Self::Ty {
119 | ^^^^^^^^^^^^^^^^^^^^^ consider calling `Tr::make`
121 error[E0308]: mismatched types
122 --> $DIR/defaults-specialization.rs:89:33
124 LL | let _: <B2<()> as Tr>::Ty = 0u8;
125 | ------------------ ^^^ expected associated type, found `u8`
127 | expected due to this
129 = note: expected associated type `<B2<()> as Tr>::Ty`
131 help: a method is available that returns `<B2<()> as Tr>::Ty`
132 --> $DIR/defaults-specialization.rs:9:5
134 LL | fn make() -> Self::Ty {
135 | ^^^^^^^^^^^^^^^^^^^^^ consider calling `Tr::make`
137 error[E0308]: mismatched types
138 --> $DIR/defaults-specialization.rs:90:33
140 LL | let _: <B2<()> as Tr>::Ty = true;
141 | ------------------ ^^^^ expected associated type, found `bool`
143 | expected due to this
145 = note: expected associated type `<B2<()> as Tr>::Ty`
147 help: a method is available that returns `<B2<()> as Tr>::Ty`
148 --> $DIR/defaults-specialization.rs:9:5
150 LL | fn make() -> Self::Ty {
151 | ^^^^^^^^^^^^^^^^^^^^^ consider calling `Tr::make`
153 error: aborting due to 9 previous errors; 1 warning emitted
155 Some errors have detailed explanations: E0053, E0308.
156 For more information about an error, try `rustc --explain E0053`.