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
10 error[E0053]: method `make` has an incompatible type for trait
11 --> $DIR/defaults-specialization.rs:19:18
13 LL | fn make() -> Self::Ty {
14 | -------- type in trait
16 LL | fn make() -> u8 { 0 }
17 | ^^ expected associated type, found `u8`
19 = note: expected fn pointer `fn() -> <A<T> as Tr>::Ty`
20 found fn pointer `fn() -> u8`
22 error[E0053]: method `make` has an incompatible type for trait
23 --> $DIR/defaults-specialization.rs:35:18
25 LL | fn make() -> Self::Ty {
26 | -------- type in trait
28 LL | default type Ty = bool;
29 | ----------------------- expected this associated type
31 LL | fn make() -> bool { true }
32 | ^^^^ expected associated type, found `bool`
34 = note: expected fn pointer `fn() -> <B<T> as Tr>::Ty`
35 found fn pointer `fn() -> bool`
37 error[E0308]: mismatched types
38 --> $DIR/defaults-specialization.rs:10:9
41 | ------------- associated type defaults can't be assumed inside the trait defining them
43 LL | fn make() -> Self::Ty {
44 | -------- expected `<Self as Tr>::Ty` because of return type
46 | ^^^ expected associated type, found `u8`
48 = note: expected associated type `<Self as Tr>::Ty`
51 error[E0308]: mismatched types
52 --> $DIR/defaults-specialization.rs:26:29
54 LL | fn make() -> Self::Ty { 0u8 }
55 | -------- ^^^ expected associated type, found `u8`
57 | expected `<A2<T> as Tr>::Ty` because of return type
59 = note: expected associated type `<A2<T> as Tr>::Ty`
61 = help: consider constraining the associated type `<A2<T> as Tr>::Ty` to `u8` or calling a method that returns `<A2<T> as Tr>::Ty`
62 = note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html
64 error[E0308]: mismatched types
65 --> $DIR/defaults-specialization.rs:44:29
67 LL | default type Ty = bool;
68 | ----------------------- expected this associated type
70 LL | fn make() -> Self::Ty { true }
71 | -------- ^^^^ expected associated type, found `bool`
73 | expected `<B2<T> as Tr>::Ty` because of return type
75 = note: expected associated type `<B2<T> as Tr>::Ty`
78 error[E0308]: mismatched types
79 --> $DIR/defaults-specialization.rs:87:32
81 LL | let _: <B<()> as Tr>::Ty = 0u8;
82 | ----------------- ^^^ expected associated type, found `u8`
84 | expected due to this
86 = note: expected associated type `<B<()> as Tr>::Ty`
88 help: a method is available that returns `<B<()> as Tr>::Ty`
89 --> $DIR/defaults-specialization.rs:9:5
91 LL | fn make() -> Self::Ty {
92 | ^^^^^^^^^^^^^^^^^^^^^ consider calling `Tr::make`
94 error[E0308]: mismatched types
95 --> $DIR/defaults-specialization.rs:88:32
97 LL | let _: <B<()> as Tr>::Ty = true;
98 | ----------------- ^^^^ expected associated type, found `bool`
100 | expected due to this
102 = note: expected associated type `<B<()> as Tr>::Ty`
104 help: a method is available that returns `<B<()> as Tr>::Ty`
105 --> $DIR/defaults-specialization.rs:9:5
107 LL | fn make() -> Self::Ty {
108 | ^^^^^^^^^^^^^^^^^^^^^ consider calling `Tr::make`
110 error[E0308]: mismatched types
111 --> $DIR/defaults-specialization.rs:89:33
113 LL | let _: <B2<()> as Tr>::Ty = 0u8;
114 | ------------------ ^^^ expected associated type, found `u8`
116 | expected due to this
118 = note: expected associated type `<B2<()> as Tr>::Ty`
120 help: a method is available that returns `<B2<()> as Tr>::Ty`
121 --> $DIR/defaults-specialization.rs:9:5
123 LL | fn make() -> Self::Ty {
124 | ^^^^^^^^^^^^^^^^^^^^^ consider calling `Tr::make`
126 error[E0308]: mismatched types
127 --> $DIR/defaults-specialization.rs:90:33
129 LL | let _: <B2<()> as Tr>::Ty = true;
130 | ------------------ ^^^^ expected associated type, found `bool`
132 | expected due to this
134 = note: expected associated type `<B2<()> as Tr>::Ty`
136 help: a method is available that returns `<B2<()> as Tr>::Ty`
137 --> $DIR/defaults-specialization.rs:9:5
139 LL | fn make() -> Self::Ty {
140 | ^^^^^^^^^^^^^^^^^^^^^ consider calling `Tr::make`
142 error: aborting due to 9 previous errors; 1 warning emitted
144 Some errors have detailed explanations: E0053, E0308.
145 For more information about an error, try `rustc --explain E0053`.