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
+
1
31
error[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
3
33
|
4
34
LL | / impl<T> Foo for Box<T> {
35
+ LL | | type Ty = bool;
36
+ LL | | const CONST: u8 = 0;
5
37
LL | | fn foo(&self) -> bool { false }
6
38
LL | | }
7
39
| |_- parent `impl` is here
@@ -11,8 +43,30 @@ LL | fn foo(&self) -> bool { true }
11
43
|
12
44
= note: to specialize, `foo` in the parent `impl` must be marked `default`
13
45
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
+
14
68
error[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
16
70
|
17
71
LL | impl<T> Foo for Vec<T> {}
18
72
| ------------------------- parent `impl` is here
@@ -22,6 +76,6 @@ LL | fn foo(&self) -> bool { true }
22
76
|
23
77
= note: to specialize, `foo` in the parent `impl` must be marked `default`
24
78
25
- error: aborting due to 2 previous errors
79
+ error: aborting due to 6 previous errors
26
80
27
81
For more information about this error, try `rustc --explain E0520`.
0 commit comments