diff options
Diffstat (limited to 'src/test/ui/rfc-2632-const-trait-impl/impl-with-default-fn-fail.stderr')
| -rw-r--r-- | src/test/ui/rfc-2632-const-trait-impl/impl-with-default-fn-fail.stderr | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/test/ui/rfc-2632-const-trait-impl/impl-with-default-fn-fail.stderr b/src/test/ui/rfc-2632-const-trait-impl/impl-with-default-fn-fail.stderr new file mode 100644 index 00000000000..a0916797041 --- /dev/null +++ b/src/test/ui/rfc-2632-const-trait-impl/impl-with-default-fn-fail.stderr @@ -0,0 +1,33 @@ +error: const trait implementations may not use non-const default functions + --> $DIR/impl-with-default-fn-fail.rs:18:1 + | +LL | / impl const Tr for S { +LL | | fn req(&self) {} +LL | | } + | |_^ + | + = note: `prov` not implemented + +error: const trait implementations may not use non-const default functions + --> $DIR/impl-with-default-fn-fail.rs:28:1 + | +LL | / impl const Tr for u32 { +LL | | fn req(&self) {} +LL | | fn default() {} +LL | | } + | |_^ + | + = note: `prov` not implemented + +error[E0046]: not all trait items implemented, missing: `req` + --> $DIR/impl-with-default-fn-fail.rs:22:1 + | +LL | fn req(&self); + | -------------- `req` from trait +... +LL | impl const Tr for u16 { + | ^^^^^^^^^^^^^^^^^^^^^ missing `req` in implementation + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0046`. |
