diff options
Diffstat (limited to 'src/test/ui/stability-attribute')
6 files changed, 56 insertions, 7 deletions
diff --git a/src/test/ui/stability-attribute/missing-const-stability.rs b/src/test/ui/stability-attribute/missing-const-stability.rs index d89886af3..6eff899bf 100644 --- a/src/test/ui/stability-attribute/missing-const-stability.rs +++ b/src/test/ui/stability-attribute/missing-const-stability.rs @@ -19,6 +19,7 @@ impl Foo { } #[stable(feature = "stable", since = "1.0.0")] +#[const_trait] pub trait Bar { #[stable(feature = "stable", since = "1.0.0")] fn fun(); diff --git a/src/test/ui/stability-attribute/missing-const-stability.stderr b/src/test/ui/stability-attribute/missing-const-stability.stderr index 10978728f..4cfbe1528 100644 --- a/src/test/ui/stability-attribute/missing-const-stability.stderr +++ b/src/test/ui/stability-attribute/missing-const-stability.stderr @@ -5,7 +5,7 @@ LL | pub const fn foo() {} | ^^^^^^^^^^^^^^^^^^^^^ error: implementation has missing const stability attribute - --> $DIR/missing-const-stability.rs:27:1 + --> $DIR/missing-const-stability.rs:28:1 | LL | / impl const Bar for Foo { LL | | diff --git a/src/test/ui/stability-attribute/stability-attribute-trait-impl.rs b/src/test/ui/stability-attribute/stability-attribute-trait-impl.rs index ce2726ffd..0c771ae87 100644 --- a/src/test/ui/stability-attribute/stability-attribute-trait-impl.rs +++ b/src/test/ui/stability-attribute/stability-attribute-trait-impl.rs @@ -1,4 +1,4 @@ -#![feature(staged_api)] +#![feature(staged_api, never_type, c_unwind)] //~^ ERROR module has missing stability attribute #[stable(feature = "a", since = "1")] @@ -23,7 +23,21 @@ impl StableTrait for UnstableType {} impl UnstableTrait for StableType {} #[unstable(feature = "h", issue = "none")] +impl StableTrait for ! {} + +// Note: If C-unwind is stabilized, switch this to another (unstable) ABI. +#[unstable(feature = "i", issue = "none")] +impl StableTrait for extern "C-unwind" fn() {} + +#[unstable(feature = "j", issue = "none")] //~^ ERROR an `#[unstable]` annotation here has no effect [ineffective_unstable_trait_impl] impl StableTrait for StableType {} +#[unstable(feature = "k", issue = "none")] +//~^ ERROR an `#[unstable]` annotation here has no effect [ineffective_unstable_trait_impl] +impl StableTrait for fn() -> ! {} + +#[unstable(feature = "l", issue = "none")] +impl StableTrait for fn() -> UnstableType {} + fn main() {} diff --git a/src/test/ui/stability-attribute/stability-attribute-trait-impl.stderr b/src/test/ui/stability-attribute/stability-attribute-trait-impl.stderr index 310f02024..b91a1d2e1 100644 --- a/src/test/ui/stability-attribute/stability-attribute-trait-impl.stderr +++ b/src/test/ui/stability-attribute/stability-attribute-trait-impl.stderr @@ -1,16 +1,24 @@ error: an `#[unstable]` annotation here has no effect - --> $DIR/stability-attribute-trait-impl.rs:25:1 + --> $DIR/stability-attribute-trait-impl.rs:32:1 | -LL | #[unstable(feature = "h", issue = "none")] +LL | #[unstable(feature = "j", issue = "none")] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | + = note: see issue #55436 <https://github.com/rust-lang/rust/issues/55436> for more information = note: `#[deny(ineffective_unstable_trait_impl)]` on by default + +error: an `#[unstable]` annotation here has no effect + --> $DIR/stability-attribute-trait-impl.rs:36:1 + | +LL | #[unstable(feature = "k", issue = "none")] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | = note: see issue #55436 <https://github.com/rust-lang/rust/issues/55436> for more information error: module has missing stability attribute --> $DIR/stability-attribute-trait-impl.rs:1:1 | -LL | / #![feature(staged_api)] +LL | / #![feature(staged_api, never_type, c_unwind)] LL | | LL | | LL | | #[stable(feature = "a", since = "1")] @@ -19,5 +27,5 @@ LL | | LL | | fn main() {} | |____________^ -error: aborting due to 2 previous errors +error: aborting due to 3 previous errors diff --git a/src/test/ui/stability-attribute/stable-in-unstable.rs b/src/test/ui/stability-attribute/stable-in-unstable.rs index 272a1a972..226367c39 100644 --- a/src/test/ui/stability-attribute/stable-in-unstable.rs +++ b/src/test/ui/stability-attribute/stable-in-unstable.rs @@ -44,3 +44,11 @@ mod isolated5 { impl stable_in_unstable_std::old_stable_module::OldTrait for LocalType {} } + +mod isolated6 { + use stable_in_unstable_core::new_unstable_module::{OldTrait}; //~ ERROR use of unstable library feature 'unstable_test_feature' +} + +mod isolated7 { + use stable_in_unstable_core::new_unstable_module::*; //~ ERROR use of unstable library feature 'unstable_test_feature' +} diff --git a/src/test/ui/stability-attribute/stable-in-unstable.stderr b/src/test/ui/stability-attribute/stable-in-unstable.stderr index e123d8358..b5e3e5f12 100644 --- a/src/test/ui/stability-attribute/stable-in-unstable.stderr +++ b/src/test/ui/stability-attribute/stable-in-unstable.stderr @@ -34,6 +34,24 @@ LL | impl stable_in_unstable_core::new_unstable_module::OldTrait for LocalTy = note: see issue #1 <https://github.com/rust-lang/rust/issues/1> for more information = help: add `#![feature(unstable_test_feature)]` to the crate attributes to enable -error: aborting due to 4 previous errors +error[E0658]: use of unstable library feature 'unstable_test_feature' + --> $DIR/stable-in-unstable.rs:49:56 + | +LL | use stable_in_unstable_core::new_unstable_module::{OldTrait}; + | ^^^^^^^^ + | + = note: see issue #1 <https://github.com/rust-lang/rust/issues/1> for more information + = help: add `#![feature(unstable_test_feature)]` to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_test_feature' + --> $DIR/stable-in-unstable.rs:53:9 + | +LL | use stable_in_unstable_core::new_unstable_module::*; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: see issue #1 <https://github.com/rust-lang/rust/issues/1> for more information + = help: add `#![feature(unstable_test_feature)]` to the crate attributes to enable + +error: aborting due to 6 previous errors For more information about this error, try `rustc --explain E0658`. |