Add test.

This commit is contained in:
Mara Bos 2022-10-19 12:41:56 +02:00
parent ead96f7f74
commit a44a22d5f4
2 changed files with 11 additions and 4 deletions

View File

@ -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,6 +23,13 @@ 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 {}

View File

@ -1,7 +1,7 @@
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
@ -10,7 +10,7 @@ LL | #[unstable(feature = "h", issue = "none")]
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")]