fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #72883 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum49cae55760d

1.44.0
2.9 KiB81 linesraw
1error[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   |
4LL | / impl<T> Foo for Box<T> {
5LL | |     type Ty = bool;
6LL | |     const CONST: u8 = 0;
7LL | |     fn foo(&self) -> bool { false }
8LL | | }
9   | |_- parent `impl` is here
10...
11LL |       type Ty = Vec<()>;
12   |       ^^^^^^^^^^^^^^^^^^ cannot specialize default item `Ty`
13   |
14   = note: to specialize, `Ty` in the parent `impl` must be marked `default`
15
16error[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   |
19LL | / impl<T> Foo for Box<T> {
20LL | |     type Ty = bool;
21LL | |     const CONST: u8 = 0;
22LL | |     fn foo(&self) -> bool { false }
23LL | | }
24   | |_- parent `impl` is here
25...
26LL |       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
31error[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   |
34LL | / impl<T> Foo for Box<T> {
35LL | |     type Ty = bool;
36LL | |     const CONST: u8 = 0;
37LL | |     fn foo(&self) -> bool { false }
38LL | | }
39   | |_- parent `impl` is here
40...
41LL |       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
46error[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   |
49LL | impl<T> Foo for Vec<T> {}
50   | ------------------------- parent `impl` is here
51...
52LL |     type Ty = Vec<()>;
53   |     ^^^^^^^^^^^^^^^^^^ cannot specialize default item `Ty`
54   |
55   = note: to specialize, `Ty` in the parent `impl` must be marked `default`
56
57error[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   |
60LL | impl<T> Foo for Vec<T> {}
61   | ------------------------- parent `impl` is here
62...
63LL |     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
68error[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   |
71LL | impl<T> Foo for Vec<T> {}
72   | ------------------------- parent `impl` is here
73...
74LL |     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
79error: aborting due to 6 previous errors
80
81For more information about this error, try `rustc --explain E0520`.