diff options
| author | Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de> | 2022-05-19 12:30:38 +0000 |
|---|---|---|
| committer | Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de> | 2022-05-19 12:30:38 +0000 |
| commit | aa9eae50f3fd6e4cc7ed0a3e8c2c2a24012e3564 (patch) | |
| tree | 55bd8bd4a59e77a16f06634f5cccab73447d991a | |
| parent | cf5a803600c7a1f18883eef30de61815690664bc (diff) | |
| download | rust-aa9eae50f3fd6e4cc7ed0a3e8c2c2a24012e3564.tar.gz rust-aa9eae50f3fd6e4cc7ed0a3e8c2c2a24012e3564.zip | |
Stable const things need a stability attribute
3 files changed, 7 insertions, 4 deletions
diff --git a/src/test/ui/rfc-2632-const-trait-impl/staged-api.rs b/src/test/ui/rfc-2632-const-trait-impl/staged-api.rs index f8a55a0a4a0..a521e986bab 100644 --- a/src/test/ui/rfc-2632-const-trait-impl/staged-api.rs +++ b/src/test/ui/rfc-2632-const-trait-impl/staged-api.rs @@ -15,6 +15,7 @@ pub struct Foo; #[stable(feature = "rust1", since = "1.0.0")] #[cfg_attr(unstable, rustc_const_unstable(feature = "foo", issue = "none"))] +#[cfg_attr(stable, rustc_const_stable(feature = "foo", since = "1.0.0"))] impl const MyTrait for Foo { //[stable]~^ ERROR trait implementations cannot be const stable yet fn func() {} diff --git a/src/test/ui/rfc-2632-const-trait-impl/staged-api.stable.stderr b/src/test/ui/rfc-2632-const-trait-impl/staged-api.stable.stderr index 25407a0b43c..6c9c660ab23 100644 --- a/src/test/ui/rfc-2632-const-trait-impl/staged-api.stable.stderr +++ b/src/test/ui/rfc-2632-const-trait-impl/staged-api.stable.stderr @@ -1,11 +1,13 @@ -error: implementation has missing const stability attribute - --> $DIR/staged-api.rs:18:1 +error: trait implementations cannot be const stable yet + --> $DIR/staged-api.rs:19:1 | LL | / impl const MyTrait for Foo { LL | | LL | | fn func() {} LL | | } | |_^ + | + = note: see issue #67792 <https://github.com/rust-lang/rust/issues/67792> for more information error: aborting due to previous error diff --git a/src/test/ui/rfc-2632-const-trait-impl/staged-api.unstable.stderr b/src/test/ui/rfc-2632-const-trait-impl/staged-api.unstable.stderr index 30fe97bb884..0401ba478fd 100644 --- a/src/test/ui/rfc-2632-const-trait-impl/staged-api.unstable.stderr +++ b/src/test/ui/rfc-2632-const-trait-impl/staged-api.unstable.stderr @@ -1,5 +1,5 @@ error: `<Foo as staged_api::MyTrait>::func` is not yet stable as a const fn - --> $DIR/staged-api.rs:34:5 + --> $DIR/staged-api.rs:35:5 | LL | Foo::func(); | ^^^^^^^^^^^ @@ -7,7 +7,7 @@ LL | Foo::func(); = help: add `#![feature(foo)]` to the crate attributes to enable error: `<Foo as staged_api::MyTrait>::func` is not yet stable as a const fn - --> $DIR/staged-api.rs:42:5 + --> $DIR/staged-api.rs:43:5 | LL | Foo::func(); | ^^^^^^^^^^^ |
