@@ -5,10 +5,12 @@ LL | fn make() -> Self::Ty {
5
5
| -------- type in trait
6
6
...
7
7
LL | fn make() -> u8 { 0 }
8
- | ^^ expected associated type, found u8
8
+ | ^^ expected associated type, found `u8`
9
9
|
10
- = note: expected type `fn() -> <A<T> as Tr>::Ty`
11
- found type `fn() -> u8`
10
+ = note: expected fn pointer `fn() -> <A<T> as Tr>::Ty`
11
+ found fn pointer `fn() -> u8`
12
+ = note: consider constraining the associated type `<A<T> as Tr>::Ty` to `u8` or calling a method that returns `<A<T> as Tr>::Ty`
13
+ = note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html
12
14
13
15
error[E0053]: method `make` has an incompatible type for trait
14
16
--> $DIR/defaults-specialization.rs:36:18
@@ -17,79 +19,95 @@ LL | fn make() -> Self::Ty {
17
19
| -------- type in trait
18
20
...
19
21
LL | fn make() -> bool { true }
20
- | ^^^^ expected associated type, found bool
22
+ | ^^^^ expected associated type, found ` bool`
21
23
|
22
- = note: expected type `fn() -> <B<T> as Tr>::Ty`
23
- found type `fn() -> bool`
24
+ = note: expected fn pointer `fn() -> <B<T> as Tr>::Ty`
25
+ found fn pointer `fn() -> bool`
26
+ = note: consider constraining the associated type `<B<T> as Tr>::Ty` to `bool` or calling a method that returns `<B<T> as Tr>::Ty`
27
+ = note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html
24
28
25
29
error[E0308]: mismatched types
26
30
--> $DIR/defaults-specialization.rs:11:9
27
31
|
28
32
LL | fn make() -> Self::Ty {
29
33
| -------- expected `<Self as Tr>::Ty` because of return type
30
34
LL | 0u8
31
- | ^^^ expected associated type, found u8
35
+ | ^^^ expected associated type, found `u8`
32
36
|
33
- = note: expected type `<Self as Tr>::Ty`
34
- found type `u8`
37
+ = note: expected associated type `<Self as Tr>::Ty`
38
+ found type `u8`
39
+ = note: consider constraining the associated type `<Self as Tr>::Ty` to `u8` or calling a method that returns `<Self as Tr>::Ty`
40
+ = note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html
35
41
36
42
error[E0308]: mismatched types
37
43
--> $DIR/defaults-specialization.rs:27:29
38
44
|
39
45
LL | fn make() -> Self::Ty { 0u8 }
40
- | -------- ^^^ expected associated type, found u8
46
+ | -------- ^^^ expected associated type, found `u8`
41
47
| |
42
48
| expected `<A2<T> as Tr>::Ty` because of return type
43
49
|
44
- = note: expected type `<A2<T> as Tr>::Ty`
45
- found type `u8`
50
+ = note: expected associated type `<A2<T> as Tr>::Ty`
51
+ found type `u8`
52
+ = note: 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
46
54
47
55
error[E0308]: mismatched types
48
56
--> $DIR/defaults-specialization.rs:45:29
49
57
|
50
58
LL | fn make() -> Self::Ty { true }
51
- | -------- ^^^^ expected associated type, found bool
59
+ | -------- ^^^^ expected associated type, found ` bool`
52
60
| |
53
61
| expected `<B2<T> as Tr>::Ty` because of return type
54
62
|
55
- = note: expected type `<B2<T> as Tr>::Ty`
56
- found type `bool`
63
+ = note: expected associated type `<B2<T> as Tr>::Ty`
64
+ found type `bool`
65
+ = note: consider constraining the associated type `<B2<T> as Tr>::Ty` to `bool` or calling a method that returns `<B2<T> as Tr>::Ty`
66
+ = note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html
57
67
58
68
error[E0308]: mismatched types
59
- --> $DIR/defaults-specialization.rs:87 :32
69
+ --> $DIR/defaults-specialization.rs:88 :32
60
70
|
61
71
LL | let _: <B<()> as Tr>::Ty = 0u8;
62
- | ^^^ expected associated type, found u8
72
+ | ^^^ expected associated type, found `u8`
63
73
|
64
- = note: expected type `<B<()> as Tr>::Ty`
65
- found type `u8`
74
+ = note: expected associated type `<B<()> as Tr>::Ty`
75
+ found type `u8`
76
+ = note: consider constraining the associated type `<B<()> as Tr>::Ty` to `u8` or calling a method that returns `<B<()> as Tr>::Ty`
77
+ = note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html
66
78
67
79
error[E0308]: mismatched types
68
- --> $DIR/defaults-specialization.rs:88 :32
80
+ --> $DIR/defaults-specialization.rs:89 :32
69
81
|
70
82
LL | let _: <B<()> as Tr>::Ty = true;
71
- | ^^^^ expected associated type, found bool
83
+ | ^^^^ expected associated type, found ` bool`
72
84
|
73
- = note: expected type `<B<()> as Tr>::Ty`
74
- found type `bool`
85
+ = note: expected associated type `<B<()> as Tr>::Ty`
86
+ found type `bool`
87
+ = note: consider constraining the associated type `<B<()> as Tr>::Ty` to `bool` or calling a method that returns `<B<()> as Tr>::Ty`
88
+ = note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html
75
89
76
90
error[E0308]: mismatched types
77
- --> $DIR/defaults-specialization.rs:89 :33
91
+ --> $DIR/defaults-specialization.rs:90 :33
78
92
|
79
93
LL | let _: <B2<()> as Tr>::Ty = 0u8;
80
- | ^^^ expected associated type, found u8
94
+ | ^^^ expected associated type, found `u8`
81
95
|
82
- = note: expected type `<B2<()> as Tr>::Ty`
83
- found type `u8`
96
+ = note: expected associated type `<B2<()> as Tr>::Ty`
97
+ found type `u8`
98
+ = note: consider constraining the associated type `<B2<()> as Tr>::Ty` to `u8` or calling a method that returns `<B2<()> as Tr>::Ty`
99
+ = note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html
84
100
85
101
error[E0308]: mismatched types
86
- --> $DIR/defaults-specialization.rs:90 :33
102
+ --> $DIR/defaults-specialization.rs:91 :33
87
103
|
88
104
LL | let _: <B2<()> as Tr>::Ty = true;
89
- | ^^^^ expected associated type, found bool
105
+ | ^^^^ expected associated type, found ` bool`
90
106
|
91
- = note: expected type `<B2<()> as Tr>::Ty`
92
- found type `bool`
107
+ = note: expected associated type `<B2<()> as Tr>::Ty`
108
+ found type `bool`
109
+ = note: consider constraining the associated type `<B2<()> as Tr>::Ty` to `bool` or calling a method that returns `<B2<()> as Tr>::Ty`
110
+ = note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html
93
111
94
112
error: aborting due to 9 previous errors
95
113
0 commit comments