]> git.lizzy.rs Git - rust.git/blob - src/test/ui/specialization/non-defaulted-item-fail.stderr
e6c5fc1441b2f4a934fb5644bcb0727a31b11d04
[rust.git] / src / test / ui / specialization / non-defaulted-item-fail.stderr
1 error[E0520]: `Ty` specializes an item from a parent `impl`, but that item is not marked `default`
2   --> $DIR/non-defaulted-item-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/non-defaulted-item-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
31 error[E0520]: `foo` specializes an item from a parent `impl`, but that item is not marked `default`
32   --> $DIR/non-defaulted-item-fail.rs:33:5
33    |
34 LL | / impl<T> Foo for Box<T> {
35 LL | |     type Ty = bool;
36 LL | |     const CONST: u8 = 0;
37 LL | |     fn foo(&self) -> bool { false }
38 LL | | }
39    | |_- parent `impl` is here
40 ...
41 LL |       fn foo(&self) -> bool { true }
42    |       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot specialize default item `foo`
43    |
44    = note: to specialize, `foo` in the parent `impl` must be marked `default`
45
46 error[E0520]: `Ty` specializes an item from a parent `impl`, but that item is not marked `default`
47   --> $DIR/non-defaulted-item-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/non-defaulted-item-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
68 error[E0520]: `foo` specializes an item from a parent `impl`, but that item is not marked `default`
69   --> $DIR/non-defaulted-item-fail.rs:49:5
70    |
71 LL | impl<T> Foo for Vec<T> {}
72    | ------------------------- parent `impl` is here
73 ...
74 LL |     fn foo(&self) -> bool { true }
75    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot specialize default item `foo`
76    |
77    = note: to specialize, `foo` in the parent `impl` must be marked `default`
78
79 error: aborting due to 6 previous errors
80
81 For more information about this error, try `rustc --explain E0520`.