1+ error[E0520]: `Ty` specializes an item from a parent `impl`, but that item is not marked `default`
2+ --> $DIR/specialization-default-methods-fail.rs:29:5
3+ |
4+ LL | / impl<T> Foo for Box<T> {
5+ LL | | type Ty = bool;
6+ LL | | const CONST: u8 = 0;
7+ LL | | fn foo(&self) -> bool { false }
8+ LL | | }
9+ | |_- parent `impl` is here
10+ ...
11+ LL | type Ty = Vec<()>;
12+ | ^^^^^^^^^^^^^^^^^^ cannot specialize default item `Ty`
13+ |
14+ = note: to specialize, `Ty` in the parent `impl` must be marked `default`
15+
16+ error[E0520]: `CONST` specializes an item from a parent `impl`, but that item is not marked `default`
17+ --> $DIR/specialization-default-methods-fail.rs:31:5
18+ |
19+ LL | / impl<T> Foo for Box<T> {
20+ LL | | type Ty = bool;
21+ LL | | const CONST: u8 = 0;
22+ LL | | fn foo(&self) -> bool { false }
23+ LL | | }
24+ | |_- parent `impl` is here
25+ ...
26+ LL | const CONST: u8 = 42;
27+ | ^^^^^^^^^^^^^^^^^^^^^ cannot specialize default item `CONST`
28+ |
29+ = note: to specialize, `CONST` in the parent `impl` must be marked `default`
30+
131error[E0520]: `foo` specializes an item from a parent `impl`, but that item is not marked `default`
2- --> $DIR/specialization-default-methods-fail.rs:27 :5
32+ --> $DIR/specialization-default-methods-fail.rs:33 :5
333 |
434LL | / impl<T> Foo for Box<T> {
35+ LL | | type Ty = bool;
36+ LL | | const CONST: u8 = 0;
537LL | | fn foo(&self) -> bool { false }
638LL | | }
739 | |_- parent `impl` is here
@@ -11,8 +43,30 @@ LL | fn foo(&self) -> bool { true }
1143 |
1244 = note: to specialize, `foo` in the parent `impl` must be marked `default`
1345
46+ error[E0520]: `Ty` specializes an item from a parent `impl`, but that item is not marked `default`
47+ --> $DIR/specialization-default-methods-fail.rs:45:5
48+ |
49+ LL | impl<T> Foo for Vec<T> {}
50+ | ------------------------- parent `impl` is here
51+ ...
52+ LL | type Ty = Vec<()>;
53+ | ^^^^^^^^^^^^^^^^^^ cannot specialize default item `Ty`
54+ |
55+ = note: to specialize, `Ty` in the parent `impl` must be marked `default`
56+
57+ error[E0520]: `CONST` specializes an item from a parent `impl`, but that item is not marked `default`
58+ --> $DIR/specialization-default-methods-fail.rs:47:5
59+ |
60+ LL | impl<T> Foo for Vec<T> {}
61+ | ------------------------- parent `impl` is here
62+ ...
63+ LL | const CONST: u8 = 42;
64+ | ^^^^^^^^^^^^^^^^^^^^^ cannot specialize default item `CONST`
65+ |
66+ = note: to specialize, `CONST` in the parent `impl` must be marked `default`
67+
1468error[E0520]: `foo` specializes an item from a parent `impl`, but that item is not marked `default`
15- --> $DIR/specialization-default-methods-fail.rs:39 :5
69+ --> $DIR/specialization-default-methods-fail.rs:49 :5
1670 |
1771LL | impl<T> Foo for Vec<T> {}
1872 | ------------------------- parent `impl` is here
@@ -22,6 +76,6 @@ LL | fn foo(&self) -> bool { true }
2276 |
2377 = note: to specialize, `foo` in the parent `impl` must be marked `default`
2478
25- error: aborting due to 2 previous errors
79+ error: aborting due to 6 previous errors
2680
2781For more information about this error, try `rustc --explain E0520`.
0 commit comments