1 warning: the feature `specialization` is incomplete and may be unsafe to use and/or cause compiler crashes
2 --> $DIR/non-defaulted-item-fail.rs:1:12
4 LL | #![feature(specialization, associated_type_defaults)]
7 = note: `#[warn(incomplete_features)]` on by default
8 = note: see issue #31844 <https://github.com/rust-lang/rust/issues/31844> for more information
10 error[E0520]: `Ty` specializes an item from a parent `impl`, but that item is not marked `default`
11 --> $DIR/non-defaulted-item-fail.rs:30:5
13 LL | / impl<T> Foo for Box<T> {
14 LL | | type Ty = bool;
15 LL | | const CONST: u8 = 0;
16 LL | | fn foo(&self) -> bool { false }
18 | |_- parent `impl` is here
20 LL | type Ty = Vec<()>;
21 | ^^^^^^^^^^^^^^^^^^ cannot specialize default item `Ty`
23 = note: to specialize, `Ty` in the parent `impl` must be marked `default`
25 error[E0520]: `CONST` specializes an item from a parent `impl`, but that item is not marked `default`
26 --> $DIR/non-defaulted-item-fail.rs:32:5
28 LL | / impl<T> Foo for Box<T> {
29 LL | | type Ty = bool;
30 LL | | const CONST: u8 = 0;
31 LL | | fn foo(&self) -> bool { false }
33 | |_- parent `impl` is here
35 LL | const CONST: u8 = 42;
36 | ^^^^^^^^^^^^^^^^^^^^^ cannot specialize default item `CONST`
38 = note: to specialize, `CONST` in the parent `impl` must be marked `default`
40 error[E0520]: `foo` specializes an item from a parent `impl`, but that item is not marked `default`
41 --> $DIR/non-defaulted-item-fail.rs:34:5
43 LL | / impl<T> Foo for Box<T> {
44 LL | | type Ty = bool;
45 LL | | const CONST: u8 = 0;
46 LL | | fn foo(&self) -> bool { false }
48 | |_- parent `impl` is here
50 LL | fn foo(&self) -> bool { true }
51 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot specialize default item `foo`
53 = note: to specialize, `foo` in the parent `impl` must be marked `default`
55 error[E0520]: `Ty` specializes an item from a parent `impl`, but that item is not marked `default`
56 --> $DIR/non-defaulted-item-fail.rs:46:5
58 LL | impl<T> Foo for Vec<T> {}
59 | ------------------------- parent `impl` is here
61 LL | type Ty = Vec<()>;
62 | ^^^^^^^^^^^^^^^^^^ cannot specialize default item `Ty`
64 = note: to specialize, `Ty` in the parent `impl` must be marked `default`
66 error[E0520]: `CONST` specializes an item from a parent `impl`, but that item is not marked `default`
67 --> $DIR/non-defaulted-item-fail.rs:48:5
69 LL | impl<T> Foo for Vec<T> {}
70 | ------------------------- parent `impl` is here
72 LL | const CONST: u8 = 42;
73 | ^^^^^^^^^^^^^^^^^^^^^ cannot specialize default item `CONST`
75 = note: to specialize, `CONST` in the parent `impl` must be marked `default`
77 error[E0520]: `foo` specializes an item from a parent `impl`, but that item is not marked `default`
78 --> $DIR/non-defaulted-item-fail.rs:50:5
80 LL | impl<T> Foo for Vec<T> {}
81 | ------------------------- parent `impl` is here
83 LL | fn foo(&self) -> bool { true }
84 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot specialize default item `foo`
86 = note: to specialize, `foo` in the parent `impl` must be marked `default`
88 error: aborting due to 6 previous errors; 1 warning emitted
90 For more information about this error, try `rustc --explain E0520`.