/src/test/auxiliary/lint_stability.rs

https://gitlab.com/pranith/rust · Rust · 170 lines · 138 code · 23 blank · 9 comment · 1 complexity · 47950fee939142247446f2b322a2226f MD5 · raw file

  1. // Copyright 2013 The Rust Project Developers. See the COPYRIGHT
  2. // file at the top-level directory of this distribution and at
  3. // http://rust-lang.org/COPYRIGHT.
  4. //
  5. // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
  6. // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
  7. // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
  8. // option. This file may not be copied, modified, or distributed
  9. // except according to those terms.
  10. #![crate_name="lint_stability"]
  11. #![crate_type = "lib"]
  12. #![feature(staged_api)]
  13. #![staged_api]
  14. #![stable(feature = "lint_stability", since = "1.0.0")]
  15. #[stable(feature = "test_feature", since = "1.0.0")]
  16. #[deprecated(since = "1.0.0")]
  17. pub fn deprecated() {}
  18. #[stable(feature = "test_feature", since = "1.0.0")]
  19. #[deprecated(since = "1.0.0", reason = "text")]
  20. pub fn deprecated_text() {}
  21. #[unstable(feature = "test_feature")]
  22. #[deprecated(since = "1.0.0")]
  23. pub fn deprecated_unstable() {}
  24. #[unstable(feature = "test_feature")]
  25. #[deprecated(since = "1.0.0", reason = "text")]
  26. pub fn deprecated_unstable_text() {}
  27. #[unstable(feature = "test_feature")]
  28. pub fn unstable() {}
  29. #[unstable(feature = "test_feature", reason = "text")]
  30. pub fn unstable_text() {}
  31. #[stable(feature = "rust1", since = "1.0.0")]
  32. pub fn stable() {}
  33. #[stable(feature = "rust1", since = "1.0.0", reason = "text")]
  34. pub fn stable_text() {}
  35. #[stable(feature = "rust1", since = "1.0.0")]
  36. pub struct MethodTester;
  37. impl MethodTester {
  38. #[stable(feature = "test_feature", since = "1.0.0")]
  39. #[deprecated(since = "1.0.0")]
  40. pub fn method_deprecated(&self) {}
  41. #[stable(feature = "test_feature", since = "1.0.0")]
  42. #[deprecated(since = "1.0.0", reason = "text")]
  43. pub fn method_deprecated_text(&self) {}
  44. #[unstable(feature = "test_feature")]
  45. #[deprecated(since = "1.0.0")]
  46. pub fn method_deprecated_unstable(&self) {}
  47. #[unstable(feature = "test_feature")]
  48. #[deprecated(since = "1.0.0", reason = "text")]
  49. pub fn method_deprecated_unstable_text(&self) {}
  50. #[unstable(feature = "test_feature")]
  51. pub fn method_unstable(&self) {}
  52. #[unstable(feature = "test_feature", reason = "text")]
  53. pub fn method_unstable_text(&self) {}
  54. #[stable(feature = "rust1", since = "1.0.0")]
  55. pub fn method_stable(&self) {}
  56. #[stable(feature = "rust1", since = "1.0.0", reason = "text")]
  57. pub fn method_stable_text(&self) {}
  58. }
  59. #[stable(feature = "test_feature", since = "1.0.0")]
  60. pub trait Trait {
  61. #[stable(feature = "test_feature", since = "1.0.0")]
  62. #[deprecated(since = "1.0.0")]
  63. fn trait_deprecated(&self) {}
  64. #[stable(feature = "test_feature", since = "1.0.0")]
  65. #[deprecated(since = "1.0.0", reason = "text")]
  66. fn trait_deprecated_text(&self) {}
  67. #[unstable(feature = "test_feature")]
  68. #[deprecated(since = "1.0.0")]
  69. fn trait_deprecated_unstable(&self) {}
  70. #[unstable(feature = "test_feature")]
  71. #[deprecated(since = "1.0.0", reason = "text")]
  72. fn trait_deprecated_unstable_text(&self) {}
  73. #[unstable(feature = "test_feature")]
  74. fn trait_unstable(&self) {}
  75. #[unstable(feature = "test_feature", reason = "text")]
  76. fn trait_unstable_text(&self) {}
  77. #[stable(feature = "rust1", since = "1.0.0")]
  78. fn trait_stable(&self) {}
  79. #[stable(feature = "rust1", since = "1.0.0", reason = "text")]
  80. fn trait_stable_text(&self) {}
  81. }
  82. impl Trait for MethodTester {}
  83. #[unstable(feature = "test_feature")]
  84. pub trait UnstableTrait { fn dummy(&self) { } }
  85. #[stable(feature = "test_feature", since = "1.0.0")]
  86. #[deprecated(since = "1.0.0")]
  87. pub struct DeprecatedStruct {
  88. #[stable(feature = "test_feature", since = "1.0.0")] pub i: isize
  89. }
  90. #[unstable(feature = "test_feature")]
  91. #[deprecated(since = "1.0.0")]
  92. pub struct DeprecatedUnstableStruct {
  93. #[stable(feature = "test_feature", since = "1.0.0")] pub i: isize
  94. }
  95. #[unstable(feature = "test_feature")]
  96. pub struct UnstableStruct {
  97. #[stable(feature = "test_feature", since = "1.0.0")] pub i: isize
  98. }
  99. #[stable(feature = "rust1", since = "1.0.0")]
  100. pub struct StableStruct {
  101. #[stable(feature = "test_feature", since = "1.0.0")] pub i: isize
  102. }
  103. #[stable(feature = "test_feature", since = "1.0.0")]
  104. #[deprecated(since = "1.0.0")]
  105. pub struct DeprecatedUnitStruct;
  106. #[unstable(feature = "test_feature")]
  107. #[deprecated(since = "1.0.0")]
  108. pub struct DeprecatedUnstableUnitStruct;
  109. #[unstable(feature = "test_feature")]
  110. pub struct UnstableUnitStruct;
  111. #[stable(feature = "rust1", since = "1.0.0")]
  112. pub struct StableUnitStruct;
  113. #[stable(feature = "test_feature", since = "1.0.0")]
  114. pub enum Enum {
  115. #[stable(feature = "test_feature", since = "1.0.0")]
  116. #[deprecated(since = "1.0.0")]
  117. DeprecatedVariant,
  118. #[unstable(feature = "test_feature")]
  119. #[deprecated(since = "1.0.0")]
  120. DeprecatedUnstableVariant,
  121. #[unstable(feature = "test_feature")]
  122. UnstableVariant,
  123. #[stable(feature = "rust1", since = "1.0.0")]
  124. StableVariant,
  125. }
  126. #[stable(feature = "test_feature", since = "1.0.0")]
  127. #[deprecated(since = "1.0.0")]
  128. pub struct DeprecatedTupleStruct(#[stable(feature = "rust1", since = "1.0.0")] pub isize);
  129. #[unstable(feature = "test_feature")]
  130. #[deprecated(since = "1.0.0")]
  131. pub struct DeprecatedUnstableTupleStruct(#[stable(feature = "rust1", since = "1.0.0")] pub isize);
  132. #[unstable(feature = "test_feature")]
  133. pub struct UnstableTupleStruct(#[stable(feature = "rust1", since = "1.0.0")] pub isize);
  134. #[stable(feature = "rust1", since = "1.0.0")]
  135. pub struct StableTupleStruct(#[stable(feature = "rust1", since = "1.0.0")] pub isize);
  136. #[macro_export]
  137. macro_rules! macro_test {
  138. () => (deprecated());
  139. }
  140. #[macro_export]
  141. macro_rules! macro_test_arg {
  142. ($func:expr) => ($func);
  143. }
  144. #[macro_export]
  145. macro_rules! macro_test_arg_nested {
  146. ($func:ident) => (macro_test_arg!($func()));
  147. }