@@ -12,10 +12,7 @@ error[E0053]: method `make` has an incompatible type for trait
12
12
--> $DIR/defaults-specialization.rs:19:18
13
13
|
14
14
LL | 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`
19
16
|
20
17
note: type in trait
21
18
--> $DIR/defaults-specialization.rs:9:18
@@ -24,6 +21,10 @@ LL | fn make() -> Self::Ty {
24
21
| ^^^^^^^^
25
22
= note: expected signature `fn() -> <A<T> as Tr>::Ty`
26
23
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
+ | ~~~~~~~~~~~~~~~~
27
28
28
29
error[E0053]: method `make` has an incompatible type for trait
29
30
--> $DIR/defaults-specialization.rs:35:18
@@ -32,10 +33,7 @@ LL | default type Ty = bool;
32
33
| ----------------------- associated type is `default` and may be overridden
33
34
LL |
34
35
LL | 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`
39
37
|
40
38
note: type in trait
41
39
--> $DIR/defaults-specialization.rs:9:18
@@ -44,6 +42,10 @@ LL | fn make() -> Self::Ty {
44
42
| ^^^^^^^^
45
43
= note: expected signature `fn() -> <B<T> as Tr>::Ty`
46
44
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
+ | ~~~~~~~~~~~~~~~~
47
49
48
50
error[E0308]: mismatched types
49
51
--> $DIR/defaults-specialization.rs:10:9
0 commit comments