@@ -5,10 +5,12 @@ LL | fn make() -> Self::Ty {
55 | -------- type in trait
66...
77LL | fn make() -> u8 { 0 }
8- | ^^ expected associated type, found u8
8+ | ^^ expected associated type, found `u8`
99 |
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
1214
1315error[E0053]: method `make` has an incompatible type for trait
1416 --> $DIR/defaults-specialization.rs:36:18
@@ -17,79 +19,95 @@ LL | fn make() -> Self::Ty {
1719 | -------- type in trait
1820...
1921LL | fn make() -> bool { true }
20- | ^^^^ expected associated type, found bool
22+ | ^^^^ expected associated type, found ` bool`
2123 |
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
2428
2529error[E0308]: mismatched types
2630 --> $DIR/defaults-specialization.rs:11:9
2731 |
2832LL | fn make() -> Self::Ty {
2933 | -------- expected `<Self as Tr>::Ty` because of return type
3034LL | 0u8
31- | ^^^ expected associated type, found u8
35+ | ^^^ expected associated type, found `u8`
3236 |
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
3541
3642error[E0308]: mismatched types
3743 --> $DIR/defaults-specialization.rs:27:29
3844 |
3945LL | fn make() -> Self::Ty { 0u8 }
40- | -------- ^^^ expected associated type, found u8
46+ | -------- ^^^ expected associated type, found `u8`
4147 | |
4248 | expected `<A2<T> as Tr>::Ty` because of return type
4349 |
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
4654
4755error[E0308]: mismatched types
4856 --> $DIR/defaults-specialization.rs:45:29
4957 |
5058LL | fn make() -> Self::Ty { true }
51- | -------- ^^^^ expected associated type, found bool
59+ | -------- ^^^^ expected associated type, found ` bool`
5260 | |
5361 | expected `<B2<T> as Tr>::Ty` because of return type
5462 |
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
5767
5868error[E0308]: mismatched types
59- --> $DIR/defaults-specialization.rs:87 :32
69+ --> $DIR/defaults-specialization.rs:88 :32
6070 |
6171LL | let _: <B<()> as Tr>::Ty = 0u8;
62- | ^^^ expected associated type, found u8
72+ | ^^^ expected associated type, found `u8`
6373 |
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
6678
6779error[E0308]: mismatched types
68- --> $DIR/defaults-specialization.rs:88 :32
80+ --> $DIR/defaults-specialization.rs:89 :32
6981 |
7082LL | let _: <B<()> as Tr>::Ty = true;
71- | ^^^^ expected associated type, found bool
83+ | ^^^^ expected associated type, found ` bool`
7284 |
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
7589
7690error[E0308]: mismatched types
77- --> $DIR/defaults-specialization.rs:89 :33
91+ --> $DIR/defaults-specialization.rs:90 :33
7892 |
7993LL | let _: <B2<()> as Tr>::Ty = 0u8;
80- | ^^^ expected associated type, found u8
94+ | ^^^ expected associated type, found `u8`
8195 |
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
84100
85101error[E0308]: mismatched types
86- --> $DIR/defaults-specialization.rs:90 :33
102+ --> $DIR/defaults-specialization.rs:91 :33
87103 |
88104LL | let _: <B2<()> as Tr>::Ty = true;
89- | ^^^^ expected associated type, found bool
105+ | ^^^^ expected associated type, found ` bool`
90106 |
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
93111
94112error: aborting due to 9 previous errors
95113
0 commit comments