]> git.lizzy.rs Git - rust.git/blob - src/test/ui/specialization/non-defaulted-item-fail.stderr
warn against 'specialization' feature
[rust.git] / src / test / ui / specialization / non-defaulted-item-fail.stderr
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
3    |
4 LL | #![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
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
12    |
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 }
17 LL | | }
18    | |_- parent `impl` is here
19 ...
20 LL |       type Ty = Vec<()>;
21    |       ^^^^^^^^^^^^^^^^^^ cannot specialize default item `Ty`
22    |
23    = note: to specialize, `Ty` in the parent `impl` must be marked `default`
24
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
27    |
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 }
32 LL | | }
33    | |_- parent `impl` is here
34 ...
35 LL |       const CONST: u8 = 42;
36    |       ^^^^^^^^^^^^^^^^^^^^^ cannot specialize default item `CONST`
37    |
38    = note: to specialize, `CONST` in the parent `impl` must be marked `default`
39
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
42    |
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 }
47 LL | | }
48    | |_- parent `impl` is here
49 ...
50 LL |       fn foo(&self) -> bool { true }
51    |       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot specialize default item `foo`
52    |
53    = note: to specialize, `foo` in the parent `impl` must be marked `default`
54
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
57    |
58 LL | impl<T> Foo for Vec<T> {}
59    | ------------------------- parent `impl` is here
60 ...
61 LL |     type Ty = Vec<()>;
62    |     ^^^^^^^^^^^^^^^^^^ cannot specialize default item `Ty`
63    |
64    = note: to specialize, `Ty` in the parent `impl` must be marked `default`
65
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
68    |
69 LL | impl<T> Foo for Vec<T> {}
70    | ------------------------- parent `impl` is here
71 ...
72 LL |     const CONST: u8 = 42;
73    |     ^^^^^^^^^^^^^^^^^^^^^ cannot specialize default item `CONST`
74    |
75    = note: to specialize, `CONST` in the parent `impl` must be marked `default`
76
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
79    |
80 LL | impl<T> Foo for Vec<T> {}
81    | ------------------------- parent `impl` is here
82 ...
83 LL |     fn foo(&self) -> bool { true }
84    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot specialize default item `foo`
85    |
86    = note: to specialize, `foo` in the parent `impl` must be marked `default`
87
88 error: aborting due to 6 previous errors; 1 warning emitted
89
90 For more information about this error, try `rustc --explain E0520`.