]> git.proxmox.com Git - rustc.git/blame - src/test/ui/specialization/non-defaulted-item-fail.stderr
New upstream version 1.49.0+dfsg1
[rustc.git] / src / test / ui / specialization / non-defaulted-item-fail.stderr
CommitLineData
72b1a166
FG
1warning: the feature `specialization` is incomplete and may not be safe to use and/or cause compiler crashes
2 --> $DIR/non-defaulted-item-fail.rs:1:12
3 |
4LL | #![feature(specialization, associated_type_defaults)]
5 | ^^^^^^^^^^^^^^
6 |
7 = note: `#[warn(incomplete_features)]` on by default
8 = note: see issue #31844 <https://github.com/rust-lang/rust/issues/31844> for more information
9 = help: consider using `min_specialization` instead, which is more stable and complete
10
e74abb32 11error[E0520]: `Ty` specializes an item from a parent `impl`, but that item is not marked `default`
72b1a166 12 --> $DIR/non-defaulted-item-fail.rs:30:5
e74abb32
XL
13 |
14LL | / impl<T> Foo for Box<T> {
15LL | | type Ty = bool;
16LL | | const CONST: u8 = 0;
17LL | | fn foo(&self) -> bool { false }
18LL | | }
19 | |_- parent `impl` is here
20...
21LL | type Ty = Vec<()>;
22 | ^^^^^^^^^^^^^^^^^^ cannot specialize default item `Ty`
23 |
24 = note: to specialize, `Ty` in the parent `impl` must be marked `default`
25
26error[E0520]: `CONST` specializes an item from a parent `impl`, but that item is not marked `default`
72b1a166 27 --> $DIR/non-defaulted-item-fail.rs:32:5
e74abb32
XL
28 |
29LL | / impl<T> Foo for Box<T> {
30LL | | type Ty = bool;
31LL | | const CONST: u8 = 0;
32LL | | fn foo(&self) -> bool { false }
33LL | | }
34 | |_- parent `impl` is here
35...
36LL | const CONST: u8 = 42;
37 | ^^^^^^^^^^^^^^^^^^^^^ cannot specialize default item `CONST`
38 |
39 = note: to specialize, `CONST` in the parent `impl` must be marked `default`
40
41error[E0520]: `foo` specializes an item from a parent `impl`, but that item is not marked `default`
72b1a166 42 --> $DIR/non-defaulted-item-fail.rs:34:5
e74abb32
XL
43 |
44LL | / impl<T> Foo for Box<T> {
45LL | | type Ty = bool;
46LL | | const CONST: u8 = 0;
47LL | | fn foo(&self) -> bool { false }
48LL | | }
49 | |_- parent `impl` is here
50...
51LL | fn foo(&self) -> bool { true }
52 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot specialize default item `foo`
53 |
54 = note: to specialize, `foo` in the parent `impl` must be marked `default`
55
56error[E0520]: `Ty` specializes an item from a parent `impl`, but that item is not marked `default`
72b1a166 57 --> $DIR/non-defaulted-item-fail.rs:46:5
e74abb32
XL
58 |
59LL | impl<T> Foo for Vec<T> {}
60 | ------------------------- parent `impl` is here
61...
62LL | type Ty = Vec<()>;
63 | ^^^^^^^^^^^^^^^^^^ cannot specialize default item `Ty`
64 |
65 = note: to specialize, `Ty` in the parent `impl` must be marked `default`
66
67error[E0520]: `CONST` specializes an item from a parent `impl`, but that item is not marked `default`
72b1a166 68 --> $DIR/non-defaulted-item-fail.rs:48:5
e74abb32
XL
69 |
70LL | impl<T> Foo for Vec<T> {}
71 | ------------------------- parent `impl` is here
72...
73LL | const CONST: u8 = 42;
74 | ^^^^^^^^^^^^^^^^^^^^^ cannot specialize default item `CONST`
75 |
76 = note: to specialize, `CONST` in the parent `impl` must be marked `default`
77
78error[E0520]: `foo` specializes an item from a parent `impl`, but that item is not marked `default`
72b1a166 79 --> $DIR/non-defaulted-item-fail.rs:50:5
e74abb32
XL
80 |
81LL | impl<T> Foo for Vec<T> {}
82 | ------------------------- parent `impl` is here
83...
84LL | fn foo(&self) -> bool { true }
85 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot specialize default item `foo`
86 |
87 = note: to specialize, `foo` in the parent `impl` must be marked `default`
88
72b1a166 89error: aborting due to 6 previous errors; 1 warning emitted
e74abb32
XL
90
91For more information about this error, try `rustc --explain E0520`.