From 1e1d6fe84dd086a9075fcfe5fc63d81738c02f12 Mon Sep 17 00:00:00 2001 From: Maybe Waffle Date: Mon, 20 Jun 2022 16:07:14 +0400 Subject: Improve error message for unstable default body --- .../ui/stability-attribute/default-body-stability-err.rs | 6 +++--- .../stability-attribute/default-body-stability-err.stderr | 14 ++++++++++---- 2 files changed, 13 insertions(+), 7 deletions(-) (limited to 'src/test') diff --git a/src/test/ui/stability-attribute/default-body-stability-err.rs b/src/test/ui/stability-attribute/default-body-stability-err.rs index 8f970d0c9f6..ecb281bccf6 100644 --- a/src/test/ui/stability-attribute/default-body-stability-err.rs +++ b/src/test/ui/stability-attribute/default-body-stability-err.rs @@ -8,11 +8,11 @@ use default_body::{Equal, JustTrait}; struct Type; impl JustTrait for Type {} -//~^ ERROR use of unstable library feature 'fun_default_body' -//~| ERROR use of unstable library feature 'constant_default_body' +//~^ ERROR not all trait items implemented, missing: `CONSTANT` [E0046] +//~| ERROR not all trait items implemented, missing: `fun` [E0046] impl Equal for Type { - //~^ ERROR use of unstable library feature 'eq_default_body' + //~^ ERROR not all trait items implemented, missing: `eq` [E0046] fn neq(&self, other: &Self) -> bool { false } diff --git a/src/test/ui/stability-attribute/default-body-stability-err.stderr b/src/test/ui/stability-attribute/default-body-stability-err.stderr index 6abf68bbcae..ef666f30fc2 100644 --- a/src/test/ui/stability-attribute/default-body-stability-err.stderr +++ b/src/test/ui/stability-attribute/default-body-stability-err.stderr @@ -1,20 +1,24 @@ -error[E0658]: use of unstable library feature 'constant_default_body' +error[E0046]: not all trait items implemented, missing: `CONSTANT` --> $DIR/default-body-stability-err.rs:10:1 | LL | impl JustTrait for Type {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^ | + = note: default implementation of `CONSTANT` is unstable + = note: use of unstable library feature 'constant_default_body' = help: add `#![feature(constant_default_body)]` to the crate attributes to enable -error[E0658]: use of unstable library feature 'fun_default_body' +error[E0046]: not all trait items implemented, missing: `fun` --> $DIR/default-body-stability-err.rs:10:1 | LL | impl JustTrait for Type {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^ | + = note: default implementation of `fun` is unstable + = note: use of unstable library feature 'fun_default_body' = help: add `#![feature(fun_default_body)]` to the crate attributes to enable -error[E0658]: use of unstable library feature 'eq_default_body' +error[E0046]: not all trait items implemented, missing: `eq` --> $DIR/default-body-stability-err.rs:14:1 | LL | / impl Equal for Type { @@ -25,8 +29,10 @@ LL | | } LL | | } | |_^ | + = note: default implementation of `eq` is unstable + = note: use of unstable library feature 'eq_default_body' = help: add `#![feature(eq_default_body)]` to the crate attributes to enable error: aborting due to 3 previous errors -For more information about this error, try `rustc --explain E0658`. +For more information about this error, try `rustc --explain E0046`. -- cgit 1.4.1-3-g733a5