1 error[E0053]: method `make` has an incompatible type for trait
2 --> $DIR/defaults-specialization.rs:18:18
4 LL | fn make() -> Self::Ty {
5 | -------- type in trait
7 LL | fn make() -> u8 { 0 }
8 | ^^ expected associated type, found `u8`
10 = note: expected fn pointer `fn() -> <A<T> as Tr>::Ty`
11 found fn pointer `fn() -> u8`
13 error[E0053]: method `make` has an incompatible type for trait
14 --> $DIR/defaults-specialization.rs:34:18
16 LL | fn make() -> Self::Ty {
17 | -------- type in trait
19 LL | default type Ty = bool;
20 | ----------------------- expected this associated type
22 LL | fn make() -> bool { true }
23 | ^^^^ expected associated type, found `bool`
25 = note: expected fn pointer `fn() -> <B<T> as Tr>::Ty`
26 found fn pointer `fn() -> bool`
28 error[E0308]: mismatched types
29 --> $DIR/defaults-specialization.rs:9:9
32 | ------------- associated type defaults can't be assumed inside the trait defining them
34 LL | fn make() -> Self::Ty {
35 | -------- expected `<Self as Tr>::Ty` because of return type
37 | ^^^ expected associated type, found `u8`
39 = note: expected associated type `<Self as Tr>::Ty`
42 error[E0308]: mismatched types
43 --> $DIR/defaults-specialization.rs:25:29
45 LL | fn make() -> Self::Ty { 0u8 }
46 | -------- ^^^ expected associated type, found `u8`
48 | expected `<A2<T> as Tr>::Ty` because of return type
50 = note: expected associated type `<A2<T> as Tr>::Ty`
52 = help: consider constraining the associated type `<A2<T> as Tr>::Ty` to `u8` or calling a method that returns `<A2<T> as Tr>::Ty`
53 = note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html
55 error[E0308]: mismatched types
56 --> $DIR/defaults-specialization.rs:43:29
58 LL | default type Ty = bool;
59 | ----------------------- expected this associated type
61 LL | fn make() -> Self::Ty { true }
62 | -------- ^^^^ expected associated type, found `bool`
64 | expected `<B2<T> as Tr>::Ty` because of return type
66 = note: expected associated type `<B2<T> as Tr>::Ty`
69 error[E0308]: mismatched types
70 --> $DIR/defaults-specialization.rs:86:32
72 LL | let _: <B<()> as Tr>::Ty = 0u8;
73 | ----------------- ^^^ expected associated type, found `u8`
75 | expected due to this
77 = note: expected associated type `<B<()> as Tr>::Ty`
79 help: a method is available that returns `<B<()> as Tr>::Ty`
80 --> $DIR/defaults-specialization.rs:8:5
82 LL | fn make() -> Self::Ty {
83 | ^^^^^^^^^^^^^^^^^^^^^ consider calling `Tr::make`
85 error[E0308]: mismatched types
86 --> $DIR/defaults-specialization.rs:87:32
88 LL | let _: <B<()> as Tr>::Ty = true;
89 | ----------------- ^^^^ expected associated type, found `bool`
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:8:5
98 LL | fn make() -> Self::Ty {
99 | ^^^^^^^^^^^^^^^^^^^^^ consider calling `Tr::make`
101 error[E0308]: mismatched types
102 --> $DIR/defaults-specialization.rs:88:33
104 LL | let _: <B2<()> as Tr>::Ty = 0u8;
105 | ------------------ ^^^ expected associated type, found `u8`
107 | expected due to this
109 = note: expected associated type `<B2<()> as Tr>::Ty`
111 help: a method is available that returns `<B2<()> as Tr>::Ty`
112 --> $DIR/defaults-specialization.rs:8: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 = true;
121 | ------------------ ^^^^ expected associated type, found `bool`
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:8:5
130 LL | fn make() -> Self::Ty {
131 | ^^^^^^^^^^^^^^^^^^^^^ consider calling `Tr::make`
133 error: aborting due to 9 previous errors
135 Some errors have detailed explanations: E0053, E0308.
136 For more information about an error, try `rustc --explain E0053`.