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 }
20 | expected associated type, found `u8`
21 | help: change the output type to match the trait: `<A<T> as Tr>::Ty`
23 = note: expected fn pointer `fn() -> <A<T> as Tr>::Ty`
24 found fn pointer `fn() -> u8`
26 error[E0053]: method `make` has an incompatible type for trait
27 --> $DIR/defaults-specialization.rs:35:18
29 LL | fn make() -> Self::Ty {
30 | -------- type in trait
32 LL | default type Ty = bool;
33 | ----------------------- expected this associated type
35 LL | fn make() -> bool { true }
38 | expected associated type, found `bool`
39 | help: change the output type to match the trait: `<B<T> as Tr>::Ty`
41 = note: expected fn pointer `fn() -> <B<T> as Tr>::Ty`
42 found fn pointer `fn() -> bool`
44 error[E0308]: mismatched types
45 --> $DIR/defaults-specialization.rs:10:9
48 | ------------- associated type defaults can't be assumed inside the trait defining them
50 LL | fn make() -> Self::Ty {
51 | -------- expected `<Self as Tr>::Ty` because of return type
53 | ^^^ expected associated type, found `u8`
55 = note: expected associated type `<Self as Tr>::Ty`
58 error[E0308]: mismatched types
59 --> $DIR/defaults-specialization.rs:26:29
61 LL | fn make() -> Self::Ty { 0u8 }
62 | -------- ^^^ expected associated type, found `u8`
64 | expected `<A2<T> as Tr>::Ty` because of return type
66 = note: expected associated type `<A2<T> as Tr>::Ty`
68 = help: consider constraining the associated type `<A2<T> as Tr>::Ty` to `u8` or calling a method that returns `<A2<T> as Tr>::Ty`
69 = note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html
71 error[E0308]: mismatched types
72 --> $DIR/defaults-specialization.rs:44:29
74 LL | default type Ty = bool;
75 | ----------------------- expected this associated type
77 LL | fn make() -> Self::Ty { true }
78 | -------- ^^^^ expected associated type, found `bool`
80 | expected `<B2<T> as Tr>::Ty` because of return type
82 = note: expected associated type `<B2<T> as Tr>::Ty`
85 error[E0308]: mismatched types
86 --> $DIR/defaults-specialization.rs:87:32
88 LL | let _: <B<()> as Tr>::Ty = 0u8;
89 | ----------------- ^^^ expected associated type, found `u8`
91 | expected due to this
93 = note: expected associated type `<B<()> as Tr>::Ty`
95 help: a method is available that returns `<B<()> as Tr>::Ty`
96 --> $DIR/defaults-specialization.rs:9:5
98 LL | fn make() -> Self::Ty {
99 | ^^^^^^^^^^^^^^^^^^^^^ consider calling `Tr::make`
101 error[E0308]: mismatched types
102 --> $DIR/defaults-specialization.rs:88:32
104 LL | let _: <B<()> as Tr>::Ty = true;
105 | ----------------- ^^^^ expected associated type, found `bool`
107 | expected due to this
109 = note: expected associated type `<B<()> as Tr>::Ty`
111 help: a method is available that returns `<B<()> as Tr>::Ty`
112 --> $DIR/defaults-specialization.rs:9:5
114 LL | fn make() -> Self::Ty {
115 | ^^^^^^^^^^^^^^^^^^^^^ consider calling `Tr::make`
117 error[E0308]: mismatched types
118 --> $DIR/defaults-specialization.rs:89:33
120 LL | let _: <B2<()> as Tr>::Ty = 0u8;
121 | ------------------ ^^^ expected associated type, found `u8`
123 | expected due to this
125 = note: expected associated type `<B2<()> as Tr>::Ty`
127 help: a method is available that returns `<B2<()> as Tr>::Ty`
128 --> $DIR/defaults-specialization.rs:9:5
130 LL | fn make() -> Self::Ty {
131 | ^^^^^^^^^^^^^^^^^^^^^ consider calling `Tr::make`
133 error[E0308]: mismatched types
134 --> $DIR/defaults-specialization.rs:90:33
136 LL | let _: <B2<()> as Tr>::Ty = true;
137 | ------------------ ^^^^ expected associated type, found `bool`
139 | expected due to this
141 = note: expected associated type `<B2<()> as Tr>::Ty`
143 help: a method is available that returns `<B2<()> as Tr>::Ty`
144 --> $DIR/defaults-specialization.rs:9:5
146 LL | fn make() -> Self::Ty {
147 | ^^^^^^^^^^^^^^^^^^^^^ consider calling `Tr::make`
149 error: aborting due to 9 previous errors; 1 warning emitted
151 Some errors have detailed explanations: E0053, E0308.
152 For more information about an error, try `rustc --explain E0053`.