summaryrefslogtreecommitdiffstats
path: root/tests/ui/rfc-2632-const-trait-impl/const_derives/derive-const-non-const-type.stderr
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/rfc-2632-const-trait-impl/const_derives/derive-const-non-const-type.stderr')
-rw-r--r--tests/ui/rfc-2632-const-trait-impl/const_derives/derive-const-non-const-type.stderr27
1 files changed, 25 insertions, 2 deletions
diff --git a/tests/ui/rfc-2632-const-trait-impl/const_derives/derive-const-non-const-type.stderr b/tests/ui/rfc-2632-const-trait-impl/const_derives/derive-const-non-const-type.stderr
index 96e0c78b9..653037ef3 100644
--- a/tests/ui/rfc-2632-const-trait-impl/const_derives/derive-const-non-const-type.stderr
+++ b/tests/ui/rfc-2632-const-trait-impl/const_derives/derive-const-non-const-type.stderr
@@ -1,3 +1,25 @@
+error[E0277]: the trait bound `A: Default` is not satisfied
+ --> $DIR/derive-const-non-const-type.rs:10:14
+ |
+LL | #[derive_const(Default)]
+ | ------- in this derive macro expansion
+LL | pub struct S(A);
+ | ^ the trait `~const Default` is not implemented for `A`
+ |
+note: the trait `Default` is implemented for `A`, but that implementation is not `const`
+ --> $DIR/derive-const-non-const-type.rs:10:14
+ |
+LL | #[derive_const(Default)]
+ | ------- in this derive macro expansion
+LL | pub struct S(A);
+ | ^
+ = note: this error originates in the derive macro `Default` (in Nightly builds, run with -Z macro-backtrace for more info)
+help: consider annotating `A` with `#[derive(Default)]`
+ |
+LL + #[derive(Default)]
+LL | pub struct A;
+ |
+
error[E0015]: cannot call non-const fn `<A as Default>::default` in constant functions
--> $DIR/derive-const-non-const-type.rs:10:14
|
@@ -10,6 +32,7 @@ LL | pub struct S(A);
= help: add `#![feature(const_trait_impl)]` to the crate attributes to enable
= note: this error originates in the derive macro `Default` (in Nightly builds, run with -Z macro-backtrace for more info)
-error: aborting due to previous error
+error: aborting due to 2 previous errors
-For more information about this error, try `rustc --explain E0015`.
+Some errors have detailed explanations: E0015, E0277.
+For more information about an error, try `rustc --explain E0015`.