@@ -12,10 +12,7 @@ error[E0053]: method `make` has an incompatible type for trait
1212 --> $DIR/defaults-specialization.rs:19:18
1313 |
1414LL | fn make() -> u8 { 0 }
15- | ^^
16- | |
17- | expected associated type, found `u8`
18- | help: change the output type to match the trait: `<A<T> as Tr>::Ty`
15+ | ^^ expected associated type, found `u8`
1916 |
2017note: type in trait
2118 --> $DIR/defaults-specialization.rs:9:18
@@ -24,6 +21,10 @@ LL | fn make() -> Self::Ty {
2421 | ^^^^^^^^
2522 = note: expected signature `fn() -> <A<T> as Tr>::Ty`
2623 found signature `fn() -> u8`
24+ help: change the output type to match the trait
25+ |
26+ LL | fn make() -> <A<T> as Tr>::Ty { 0 }
27+ | ~~~~~~~~~~~~~~~~
2728
2829error[E0053]: method `make` has an incompatible type for trait
2930 --> $DIR/defaults-specialization.rs:35:18
@@ -32,10 +33,7 @@ LL | default type Ty = bool;
3233 | ----------------------- associated type is `default` and may be overridden
3334LL |
3435LL | fn make() -> bool { true }
35- | ^^^^
36- | |
37- | expected associated type, found `bool`
38- | help: change the output type to match the trait: `<B<T> as Tr>::Ty`
36+ | ^^^^ expected associated type, found `bool`
3937 |
4038note: type in trait
4139 --> $DIR/defaults-specialization.rs:9:18
@@ -44,6 +42,10 @@ LL | fn make() -> Self::Ty {
4442 | ^^^^^^^^
4543 = note: expected signature `fn() -> <B<T> as Tr>::Ty`
4644 found signature `fn() -> bool`
45+ help: change the output type to match the trait
46+ |
47+ LL | fn make() -> <B<T> as Tr>::Ty { true }
48+ | ~~~~~~~~~~~~~~~~
4749
4850error[E0308]: mismatched types
4951 --> $DIR/defaults-specialization.rs:10:9
0 commit comments