11error[E0053]: method `make` has an incompatible type for trait
2- --> $DIR/defaults-specialization.rs:17 :18
2+ --> $DIR/defaults-specialization.rs:20 :18
33 |
4- LL | fn make() -> Self::Ty;
4+ LL | fn make() -> Self::Ty {
55 | -------- type in trait
66...
77LL | fn make() -> u8 { 0 }
@@ -11,9 +11,9 @@ LL | fn make() -> u8 { 0 }
1111 found type `fn() -> u8`
1212
1313error[E0053]: method `make` has an incompatible type for trait
14- --> $DIR/defaults-specialization.rs:33 :18
14+ --> $DIR/defaults-specialization.rs:36 :18
1515 |
16- LL | fn make() -> Self::Ty;
16+ LL | fn make() -> Self::Ty {
1717 | -------- type in trait
1818...
1919LL | fn make() -> bool { true }
@@ -23,7 +23,18 @@ LL | fn make() -> bool { true }
2323 found type `fn() -> bool`
2424
2525error[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
2738 |
2839LL | fn make() -> Self::Ty { 0u8 }
2940 | -------- ^^^ expected associated type, found u8
@@ -34,7 +45,7 @@ LL | fn make() -> Self::Ty { 0u8 }
3445 found type `u8`
3546
3647error[E0308]: mismatched types
37- --> $DIR/defaults-specialization.rs:42 :29
48+ --> $DIR/defaults-specialization.rs:45 :29
3849 |
3950LL | fn make() -> Self::Ty { true }
4051 | -------- ^^^^ expected associated type, found bool
@@ -44,7 +55,43 @@ LL | fn make() -> Self::Ty { true }
4455 = note: expected type `<B2<T> as Tr>::Ty`
4556 found type `bool`
4657
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
4895
4996Some errors have detailed explanations: E0053, E0308.
5097For more information about an error, try `rustc --explain E0053`.
0 commit comments