rust/tests/ui/stability-attribute/stability-attribute-trait-impl.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

44 lines
1.2 KiB
Rust
Raw Normal View History

2022-10-19 05:41:56 -05:00
#![feature(staged_api, never_type, c_unwind)]
//~^ ERROR module has missing stability attribute
2020-09-10 13:55:04 -05:00
#[stable(feature = "a", since = "1")]
2020-09-10 13:55:04 -05:00
struct StableType;
#[unstable(feature = "b", issue = "none")]
2020-09-10 13:55:04 -05:00
struct UnstableType;
#[stable(feature = "c", since = "1")]
2020-09-10 13:55:04 -05:00
trait StableTrait {}
#[unstable(feature = "d", issue = "none")]
2020-09-10 13:55:04 -05:00
trait UnstableTrait {}
#[unstable(feature = "e", issue = "none")]
2020-09-10 13:55:04 -05:00
impl UnstableTrait for UnstableType {}
#[unstable(feature = "f", issue = "none")]
2020-09-10 13:55:04 -05:00
impl StableTrait for UnstableType {}
#[unstable(feature = "g", issue = "none")]
2020-09-10 13:55:04 -05:00
impl UnstableTrait for StableType {}
#[unstable(feature = "h", issue = "none")]
2022-10-19 05:41:56 -05:00
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]
2020-09-10 13:55:04 -05:00
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 {}
2020-09-10 13:55:04 -05:00
fn main() {}