|
1 |
| -error[E0658]: use of unstable const library feature `const_default` |
| 1 | +error: const `impl` for trait `Debug` which is not marked with `#[const_trait]` |
2 | 2 | --> $DIR/derive-const-non-const-type.rs:10:16
|
3 | 3 | |
|
4 |
| -LL | #[derive_const(Default)] |
5 |
| - | ^^^^^^^ trait is not stable as const yet |
| 4 | +LL | #[derive_const(Debug)] |
| 5 | + | ^^^^^ this trait is not `const` |
6 | 6 | |
|
7 |
| - = help: add `#![feature(const_default)]` to the crate attributes to enable |
8 |
| - = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date |
| 7 | + = note: marking a trait with `#[const_trait]` ensures all default method bodies are `const` |
| 8 | + = note: adding a non-const method body in the future would be a breaking change |
9 | 9 |
|
10 |
| -error[E0015]: cannot call non-const associated function `<A as Default>::default` in constant functions |
| 10 | +error[E0277]: `A` doesn't implement `Debug` |
11 | 11 | --> $DIR/derive-const-non-const-type.rs:11:14
|
12 | 12 | |
|
13 |
| -LL | #[derive_const(Default)] |
14 |
| - | ------- in this derive macro expansion |
| 13 | +LL | #[derive_const(Debug)] |
| 14 | + | ----- in this derive macro expansion |
15 | 15 | LL | pub struct S(A);
|
16 |
| - | ^ |
| 16 | + | ^ the trait `Debug` is not implemented for `A` |
| 17 | + | |
| 18 | + = note: add `#[derive(Debug)]` to `A` or manually `impl Debug for A` |
| 19 | +help: consider annotating `A` with `#[derive(Debug)]` |
| 20 | + | |
| 21 | +LL + #[derive(Debug)] |
| 22 | +LL | pub struct A; |
17 | 23 | |
|
18 |
| - = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants |
19 | 24 |
|
20 | 25 | error: aborting due to 2 previous errors
|
21 | 26 |
|
22 |
| -Some errors have detailed explanations: E0015, E0658. |
23 |
| -For more information about an error, try `rustc --explain E0015`. |
| 27 | +For more information about this error, try `rustc --explain E0277`. |
0 commit comments