1
1
error[E0053]: method `make` has an incompatible type for trait
2
- --> $DIR/defaults-specialization.rs:17 :18
2
+ --> $DIR/defaults-specialization.rs:20 :18
3
3
|
4
- LL | fn make() -> Self::Ty;
4
+ LL | fn make() -> Self::Ty {
5
5
| -------- type in trait
6
6
...
7
7
LL | fn make() -> u8 { 0 }
@@ -11,9 +11,9 @@ LL | fn make() -> u8 { 0 }
11
11
found type `fn() -> u8`
12
12
13
13
error[E0053]: method `make` has an incompatible type for trait
14
- --> $DIR/defaults-specialization.rs:33 :18
14
+ --> $DIR/defaults-specialization.rs:36 :18
15
15
|
16
- LL | fn make() -> Self::Ty;
16
+ LL | fn make() -> Self::Ty {
17
17
| -------- type in trait
18
18
...
19
19
LL | fn make() -> bool { true }
@@ -23,7 +23,18 @@ LL | fn make() -> bool { true }
23
23
found type `fn() -> bool`
24
24
25
25
error[E0308]: mismatched types
26
- --> $DIR/defaults-specialization.rs:24:29
26
+ --> $DIR/defaults-specialization.rs:11:9
27
+ |
28
+ LL | fn make() -> Self::Ty {
29
+ | -------- expected `<Self as Tr>::Ty` because of return type
30
+ LL | 0u8
31
+ | ^^^ expected associated type, found u8
32
+ |
33
+ = note: expected type `<Self as Tr>::Ty`
34
+ found type `u8`
35
+
36
+ error[E0308]: mismatched types
37
+ --> $DIR/defaults-specialization.rs:27:29
27
38
|
28
39
LL | fn make() -> Self::Ty { 0u8 }
29
40
| -------- ^^^ expected associated type, found u8
@@ -34,7 +45,7 @@ LL | fn make() -> Self::Ty { 0u8 }
34
45
found type `u8`
35
46
36
47
error[E0308]: mismatched types
37
- --> $DIR/defaults-specialization.rs:42 :29
48
+ --> $DIR/defaults-specialization.rs:45 :29
38
49
|
39
50
LL | fn make() -> Self::Ty { true }
40
51
| -------- ^^^^ expected associated type, found bool
@@ -44,7 +55,43 @@ LL | fn make() -> Self::Ty { true }
44
55
= note: expected type `<B2<T> as Tr>::Ty`
45
56
found type `bool`
46
57
47
- error: aborting due to 4 previous errors
58
+ error[E0308]: mismatched types
59
+ --> $DIR/defaults-specialization.rs:87:32
60
+ |
61
+ LL | let _: <B<()> as Tr>::Ty = 0u8;
62
+ | ^^^ expected associated type, found u8
63
+ |
64
+ = note: expected type `<B<()> as Tr>::Ty`
65
+ found type `u8`
66
+
67
+ error[E0308]: mismatched types
68
+ --> $DIR/defaults-specialization.rs:88:32
69
+ |
70
+ LL | let _: <B<()> as Tr>::Ty = true;
71
+ | ^^^^ expected associated type, found bool
72
+ |
73
+ = note: expected type `<B<()> as Tr>::Ty`
74
+ found type `bool`
75
+
76
+ error[E0308]: mismatched types
77
+ --> $DIR/defaults-specialization.rs:89:33
78
+ |
79
+ LL | let _: <B2<()> as Tr>::Ty = 0u8;
80
+ | ^^^ expected associated type, found u8
81
+ |
82
+ = note: expected type `<B2<()> as Tr>::Ty`
83
+ found type `u8`
84
+
85
+ error[E0308]: mismatched types
86
+ --> $DIR/defaults-specialization.rs:90:33
87
+ |
88
+ LL | let _: <B2<()> as Tr>::Ty = true;
89
+ | ^^^^ expected associated type, found bool
90
+ |
91
+ = note: expected type `<B2<()> as Tr>::Ty`
92
+ found type `bool`
93
+
94
+ error: aborting due to 9 previous errors
48
95
49
96
Some errors have detailed explanations: E0053, E0308.
50
97
For more information about an error, try `rustc --explain E0053`.
0 commit comments