rust/tests/ui/stability-attribute/auxiliary/lint-stability.rs

189 lines
7.1 KiB
Rust
Raw Normal View History

#![crate_name="lint_stability"]
#![crate_type = "lib"]
#![feature(staged_api)]
#![feature(associated_type_defaults)]
#![stable(feature = "lint_stability", since = "1.0.0")]
2018-07-23 06:22:23 -05:00
#[stable(feature = "stable_test_feature", since = "1.0.0")]
2022-03-04 20:59:18 -06:00
#[deprecated(since = "1.0.0", note = "text")]
pub fn deprecated() {}
2018-07-23 06:22:23 -05:00
#[stable(feature = "stable_test_feature", since = "1.0.0")]
2022-03-04 20:59:18 -06:00
#[deprecated(since = "1.0.0", note = "text")]
pub fn deprecated_text() {}
2018-07-23 06:22:23 -05:00
#[stable(feature = "stable_test_feature", since = "1.0.0")]
2022-03-04 20:59:18 -06:00
#[deprecated(since = "99.99.99", note = "text")]
pub fn deprecated_future() {}
#[unstable(feature = "unstable_test_feature", issue = "none")]
2022-03-04 20:59:18 -06:00
#[deprecated(since = "1.0.0", note = "text")]
pub fn deprecated_unstable() {}
#[unstable(feature = "unstable_test_feature", issue = "none")]
2022-03-04 20:59:18 -06:00
#[deprecated(since = "1.0.0", note = "text")]
pub fn deprecated_unstable_text() {}
#[unstable(feature = "unstable_test_feature", issue = "none")]
pub fn unstable() {}
#[unstable(feature = "unstable_test_feature", reason = "text", issue = "none")]
pub fn unstable_text() {}
#[stable(feature = "rust1", since = "1.0.0")]
pub fn stable() {}
#[stable(feature = "rust1", since = "1.0.0")]
pub fn stable_text() {}
#[stable(feature = "rust1", since = "1.0.0")]
pub struct MethodTester;
impl MethodTester {
2018-07-23 06:22:23 -05:00
#[stable(feature = "stable_test_feature", since = "1.0.0")]
2022-03-04 20:59:18 -06:00
#[deprecated(since = "1.0.0", note = "text")]
pub fn method_deprecated(&self) {}
2018-07-23 06:22:23 -05:00
#[stable(feature = "stable_test_feature", since = "1.0.0")]
2022-03-04 20:59:18 -06:00
#[deprecated(since = "1.0.0", note = "text")]
pub fn method_deprecated_text(&self) {}
#[unstable(feature = "unstable_test_feature", issue = "none")]
2022-03-04 20:59:18 -06:00
#[deprecated(since = "1.0.0", note = "text")]
pub fn method_deprecated_unstable(&self) {}
#[unstable(feature = "unstable_test_feature", issue = "none")]
2022-03-04 20:59:18 -06:00
#[deprecated(since = "1.0.0", note = "text")]
pub fn method_deprecated_unstable_text(&self) {}
#[unstable(feature = "unstable_test_feature", issue = "none")]
pub fn method_unstable(&self) {}
#[unstable(feature = "unstable_test_feature", reason = "text", issue = "none")]
pub fn method_unstable_text(&self) {}
#[stable(feature = "rust1", since = "1.0.0")]
pub fn method_stable(&self) {}
#[stable(feature = "rust1", since = "1.0.0")]
pub fn method_stable_text(&self) {}
}
2018-07-23 06:22:23 -05:00
#[stable(feature = "stable_test_feature", since = "1.0.0")]
pub trait Trait {
2018-07-23 06:22:23 -05:00
#[stable(feature = "stable_test_feature", since = "1.0.0")]
2022-03-04 20:59:18 -06:00
#[deprecated(since = "1.0.0", note = "text")]
fn trait_deprecated(&self) {}
2018-07-23 06:22:23 -05:00
#[stable(feature = "stable_test_feature", since = "1.0.0")]
2022-03-04 20:59:18 -06:00
#[deprecated(since = "1.0.0", note = "text")]
fn trait_deprecated_text(&self) {}
#[unstable(feature = "unstable_test_feature", issue = "none")]
2022-03-04 20:59:18 -06:00
#[deprecated(since = "1.0.0", note = "text")]
fn trait_deprecated_unstable(&self) {}
#[unstable(feature = "unstable_test_feature", issue = "none")]
2022-03-04 20:59:18 -06:00
#[deprecated(since = "1.0.0", note = "text")]
fn trait_deprecated_unstable_text(&self) {}
#[unstable(feature = "unstable_test_feature", issue = "none")]
fn trait_unstable(&self) {}
#[unstable(feature = "unstable_test_feature", reason = "text", issue = "none")]
fn trait_unstable_text(&self) {}
#[stable(feature = "rust1", since = "1.0.0")]
fn trait_stable(&self) {}
#[stable(feature = "rust1", since = "1.0.0")]
fn trait_stable_text(&self) {}
}
2018-07-23 06:22:23 -05:00
#[stable(feature = "stable_test_feature", since = "1.0.0")]
pub trait TraitWithAssociatedTypes {
#[unstable(feature = "unstable_test_feature", issue = "none")]
type TypeUnstable = u8;
2018-07-23 06:22:23 -05:00
#[stable(feature = "stable_test_feature", since = "1.0.0")]
2022-03-04 20:59:18 -06:00
#[deprecated(since = "1.0.0", note = "text")]
type TypeDeprecated = u8;
}
2018-07-23 06:22:23 -05:00
#[stable(feature = "stable_test_feature", since = "1.0.0")]
impl Trait for MethodTester {}
#[unstable(feature = "unstable_test_feature", issue = "none")]
pub trait UnstableTrait { fn dummy(&self) { } }
2018-07-23 06:22:23 -05:00
#[stable(feature = "stable_test_feature", since = "1.0.0")]
2022-03-04 20:59:18 -06:00
#[deprecated(since = "1.0.0", note = "text")]
pub trait DeprecatedTrait {
2018-07-23 06:22:23 -05:00
#[stable(feature = "stable_test_feature", since = "1.0.0")] fn dummy(&self) { }
}
2018-07-23 06:22:23 -05:00
#[stable(feature = "stable_test_feature", since = "1.0.0")]
2022-03-04 20:59:18 -06:00
#[deprecated(since = "1.0.0", note = "text")]
pub struct DeprecatedStruct {
2018-07-23 06:22:23 -05:00
#[stable(feature = "stable_test_feature", since = "1.0.0")] pub i: isize
}
#[unstable(feature = "unstable_test_feature", issue = "none")]
2022-03-04 20:59:18 -06:00
#[deprecated(since = "1.0.0", note = "text")]
pub struct DeprecatedUnstableStruct {
2018-07-23 06:22:23 -05:00
#[stable(feature = "stable_test_feature", since = "1.0.0")] pub i: isize
}
#[unstable(feature = "unstable_test_feature", issue = "none")]
pub struct UnstableStruct {
2018-07-23 06:22:23 -05:00
#[stable(feature = "stable_test_feature", since = "1.0.0")] pub i: isize
}
#[stable(feature = "rust1", since = "1.0.0")]
pub struct StableStruct {
2018-07-23 06:22:23 -05:00
#[stable(feature = "stable_test_feature", since = "1.0.0")] pub i: isize
}
#[unstable(feature = "unstable_test_feature", issue = "none")]
pub enum UnstableEnum {}
#[stable(feature = "rust1", since = "1.0.0")]
pub enum StableEnum {}
2018-07-23 06:22:23 -05:00
#[stable(feature = "stable_test_feature", since = "1.0.0")]
2022-03-04 20:59:18 -06:00
#[deprecated(since = "1.0.0", note = "text")]
pub struct DeprecatedUnitStruct;
#[unstable(feature = "unstable_test_feature", issue = "none")]
2022-03-04 20:59:18 -06:00
#[deprecated(since = "1.0.0", note = "text")]
pub struct DeprecatedUnstableUnitStruct;
#[unstable(feature = "unstable_test_feature", issue = "none")]
pub struct UnstableUnitStruct;
#[stable(feature = "rust1", since = "1.0.0")]
pub struct StableUnitStruct;
2018-07-23 06:22:23 -05:00
#[stable(feature = "stable_test_feature", since = "1.0.0")]
pub enum Enum {
2018-07-23 06:22:23 -05:00
#[stable(feature = "stable_test_feature", since = "1.0.0")]
2022-03-04 20:59:18 -06:00
#[deprecated(since = "1.0.0", note = "text")]
DeprecatedVariant,
#[unstable(feature = "unstable_test_feature", issue = "none")]
2022-03-04 20:59:18 -06:00
#[deprecated(since = "1.0.0", note = "text")]
DeprecatedUnstableVariant,
#[unstable(feature = "unstable_test_feature", issue = "none")]
UnstableVariant,
#[stable(feature = "rust1", since = "1.0.0")]
StableVariant,
}
2018-07-23 06:22:23 -05:00
#[stable(feature = "stable_test_feature", since = "1.0.0")]
2022-03-04 20:59:18 -06:00
#[deprecated(since = "1.0.0", note = "text")]
pub struct DeprecatedTupleStruct(#[stable(feature = "rust1", since = "1.0.0")] pub isize);
#[unstable(feature = "unstable_test_feature", issue = "none")]
2022-03-04 20:59:18 -06:00
#[deprecated(since = "1.0.0", note = "text")]
pub struct DeprecatedUnstableTupleStruct(#[stable(feature = "rust1", since = "1.0.0")] pub isize);
#[unstable(feature = "unstable_test_feature", issue = "none")]
pub struct UnstableTupleStruct(#[stable(feature = "rust1", since = "1.0.0")] pub isize);
#[stable(feature = "rust1", since = "1.0.0")]
pub struct StableTupleStruct(#[stable(feature = "rust1", since = "1.0.0")] pub isize);
2018-07-23 06:22:23 -05:00
#[stable(feature = "stable_test_feature", since = "1.0.0")]
#[macro_export]
macro_rules! macro_test {
() => (deprecated());
}
2018-07-23 06:22:23 -05:00
#[stable(feature = "stable_test_feature", since = "1.0.0")]
#[macro_export]
macro_rules! macro_test_arg {
($func:expr) => ($func);
}
2018-07-23 06:22:23 -05:00
#[stable(feature = "stable_test_feature", since = "1.0.0")]
#[macro_export]
macro_rules! macro_test_arg_nested {
($func:ident) => (macro_test_arg!($func()));
}