/src/test/ui/stability-attribute/auxiliary/lint-stability.rs

https://gitlab.com/rust-lang/rust · Rust · 188 lines · 162 code · 26 blank · 0 comment · 1 complexity · 26627affee1d78f6f6c183538083860b MD5 · raw file

  1. #![crate_name="lint_stability"]
  2. #![crate_type = "lib"]
  3. #![feature(staged_api)]
  4. #![feature(associated_type_defaults)]
  5. #![stable(feature = "lint_stability", since = "1.0.0")]
  6. #[stable(feature = "stable_test_feature", since = "1.0.0")]
  7. #[deprecated(since = "1.0.0", note = "text")]
  8. pub fn deprecated() {}
  9. #[stable(feature = "stable_test_feature", since = "1.0.0")]
  10. #[deprecated(since = "1.0.0", note = "text")]
  11. pub fn deprecated_text() {}
  12. #[stable(feature = "stable_test_feature", since = "1.0.0")]
  13. #[deprecated(since = "99.99.99", note = "text")]
  14. pub fn deprecated_future() {}
  15. #[unstable(feature = "unstable_test_feature", issue = "none")]
  16. #[deprecated(since = "1.0.0", note = "text")]
  17. pub fn deprecated_unstable() {}
  18. #[unstable(feature = "unstable_test_feature", issue = "none")]
  19. #[deprecated(since = "1.0.0", note = "text")]
  20. pub fn deprecated_unstable_text() {}
  21. #[unstable(feature = "unstable_test_feature", issue = "none")]
  22. pub fn unstable() {}
  23. #[unstable(feature = "unstable_test_feature", reason = "text", issue = "none")]
  24. pub fn unstable_text() {}
  25. #[stable(feature = "rust1", since = "1.0.0")]
  26. pub fn stable() {}
  27. #[stable(feature = "rust1", since = "1.0.0")]
  28. pub fn stable_text() {}
  29. #[stable(feature = "rust1", since = "1.0.0")]
  30. pub struct MethodTester;
  31. impl MethodTester {
  32. #[stable(feature = "stable_test_feature", since = "1.0.0")]
  33. #[deprecated(since = "1.0.0", note = "text")]
  34. pub fn method_deprecated(&self) {}
  35. #[stable(feature = "stable_test_feature", since = "1.0.0")]
  36. #[deprecated(since = "1.0.0", note = "text")]
  37. pub fn method_deprecated_text(&self) {}
  38. #[unstable(feature = "unstable_test_feature", issue = "none")]
  39. #[deprecated(since = "1.0.0", note = "text")]
  40. pub fn method_deprecated_unstable(&self) {}
  41. #[unstable(feature = "unstable_test_feature", issue = "none")]
  42. #[deprecated(since = "1.0.0", note = "text")]
  43. pub fn method_deprecated_unstable_text(&self) {}
  44. #[unstable(feature = "unstable_test_feature", issue = "none")]
  45. pub fn method_unstable(&self) {}
  46. #[unstable(feature = "unstable_test_feature", reason = "text", issue = "none")]
  47. pub fn method_unstable_text(&self) {}
  48. #[stable(feature = "rust1", since = "1.0.0")]
  49. pub fn method_stable(&self) {}
  50. #[stable(feature = "rust1", since = "1.0.0")]
  51. pub fn method_stable_text(&self) {}
  52. }
  53. #[stable(feature = "stable_test_feature", since = "1.0.0")]
  54. pub trait Trait {
  55. #[stable(feature = "stable_test_feature", since = "1.0.0")]
  56. #[deprecated(since = "1.0.0", note = "text")]
  57. fn trait_deprecated(&self) {}
  58. #[stable(feature = "stable_test_feature", since = "1.0.0")]
  59. #[deprecated(since = "1.0.0", note = "text")]
  60. fn trait_deprecated_text(&self) {}
  61. #[unstable(feature = "unstable_test_feature", issue = "none")]
  62. #[deprecated(since = "1.0.0", note = "text")]
  63. fn trait_deprecated_unstable(&self) {}
  64. #[unstable(feature = "unstable_test_feature", issue = "none")]
  65. #[deprecated(since = "1.0.0", note = "text")]
  66. fn trait_deprecated_unstable_text(&self) {}
  67. #[unstable(feature = "unstable_test_feature", issue = "none")]
  68. fn trait_unstable(&self) {}
  69. #[unstable(feature = "unstable_test_feature", reason = "text", issue = "none")]
  70. fn trait_unstable_text(&self) {}
  71. #[stable(feature = "rust1", since = "1.0.0")]
  72. fn trait_stable(&self) {}
  73. #[stable(feature = "rust1", since = "1.0.0")]
  74. fn trait_stable_text(&self) {}
  75. }
  76. #[stable(feature = "stable_test_feature", since = "1.0.0")]
  77. pub trait TraitWithAssociatedTypes {
  78. #[unstable(feature = "unstable_test_feature", issue = "none")]
  79. type TypeUnstable = u8;
  80. #[stable(feature = "stable_test_feature", since = "1.0.0")]
  81. #[deprecated(since = "1.0.0", note = "text")]
  82. type TypeDeprecated = u8;
  83. }
  84. #[stable(feature = "stable_test_feature", since = "1.0.0")]
  85. impl Trait for MethodTester {}
  86. #[unstable(feature = "unstable_test_feature", issue = "none")]
  87. pub trait UnstableTrait { fn dummy(&self) { } }
  88. #[stable(feature = "stable_test_feature", since = "1.0.0")]
  89. #[deprecated(since = "1.0.0", note = "text")]
  90. pub trait DeprecatedTrait {
  91. #[stable(feature = "stable_test_feature", since = "1.0.0")] fn dummy(&self) { }
  92. }
  93. #[stable(feature = "stable_test_feature", since = "1.0.0")]
  94. #[deprecated(since = "1.0.0", note = "text")]
  95. pub struct DeprecatedStruct {
  96. #[stable(feature = "stable_test_feature", since = "1.0.0")] pub i: isize
  97. }
  98. #[unstable(feature = "unstable_test_feature", issue = "none")]
  99. #[deprecated(since = "1.0.0", note = "text")]
  100. pub struct DeprecatedUnstableStruct {
  101. #[stable(feature = "stable_test_feature", since = "1.0.0")] pub i: isize
  102. }
  103. #[unstable(feature = "unstable_test_feature", issue = "none")]
  104. pub struct UnstableStruct {
  105. #[stable(feature = "stable_test_feature", since = "1.0.0")] pub i: isize
  106. }
  107. #[stable(feature = "rust1", since = "1.0.0")]
  108. pub struct StableStruct {
  109. #[stable(feature = "stable_test_feature", since = "1.0.0")] pub i: isize
  110. }
  111. #[unstable(feature = "unstable_test_feature", issue = "none")]
  112. pub enum UnstableEnum {}
  113. #[stable(feature = "rust1", since = "1.0.0")]
  114. pub enum StableEnum {}
  115. #[stable(feature = "stable_test_feature", since = "1.0.0")]
  116. #[deprecated(since = "1.0.0", note = "text")]
  117. pub struct DeprecatedUnitStruct;
  118. #[unstable(feature = "unstable_test_feature", issue = "none")]
  119. #[deprecated(since = "1.0.0", note = "text")]
  120. pub struct DeprecatedUnstableUnitStruct;
  121. #[unstable(feature = "unstable_test_feature", issue = "none")]
  122. pub struct UnstableUnitStruct;
  123. #[stable(feature = "rust1", since = "1.0.0")]
  124. pub struct StableUnitStruct;
  125. #[stable(feature = "stable_test_feature", since = "1.0.0")]
  126. pub enum Enum {
  127. #[stable(feature = "stable_test_feature", since = "1.0.0")]
  128. #[deprecated(since = "1.0.0", note = "text")]
  129. DeprecatedVariant,
  130. #[unstable(feature = "unstable_test_feature", issue = "none")]
  131. #[deprecated(since = "1.0.0", note = "text")]
  132. DeprecatedUnstableVariant,
  133. #[unstable(feature = "unstable_test_feature", issue = "none")]
  134. UnstableVariant,
  135. #[stable(feature = "rust1", since = "1.0.0")]
  136. StableVariant,
  137. }
  138. #[stable(feature = "stable_test_feature", since = "1.0.0")]
  139. #[deprecated(since = "1.0.0", note = "text")]
  140. pub struct DeprecatedTupleStruct(#[stable(feature = "rust1", since = "1.0.0")] pub isize);
  141. #[unstable(feature = "unstable_test_feature", issue = "none")]
  142. #[deprecated(since = "1.0.0", note = "text")]
  143. pub struct DeprecatedUnstableTupleStruct(#[stable(feature = "rust1", since = "1.0.0")] pub isize);
  144. #[unstable(feature = "unstable_test_feature", issue = "none")]
  145. pub struct UnstableTupleStruct(#[stable(feature = "rust1", since = "1.0.0")] pub isize);
  146. #[stable(feature = "rust1", since = "1.0.0")]
  147. pub struct StableTupleStruct(#[stable(feature = "rust1", since = "1.0.0")] pub isize);
  148. #[stable(feature = "stable_test_feature", since = "1.0.0")]
  149. #[macro_export]
  150. macro_rules! macro_test {
  151. () => (deprecated());
  152. }
  153. #[stable(feature = "stable_test_feature", since = "1.0.0")]
  154. #[macro_export]
  155. macro_rules! macro_test_arg {
  156. ($func:expr) => ($func);
  157. }
  158. #[stable(feature = "stable_test_feature", since = "1.0.0")]
  159. #[macro_export]
  160. macro_rules! macro_test_arg_nested {
  161. ($func:ident) => (macro_test_arg!($func()));
  162. }