/src/test/auxiliary/inherited_stability.rs

https://gitlab.com/pranith/rust · Rust · 55 lines · 36 code · 10 blank · 9 comment · 1 complexity · 9e97ffdc590fb84e1278697f45d49301 MD5 · raw file

  1. // Copyright 2014 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="inherited_stability"]
  11. #![crate_type = "lib"]
  12. #![unstable(feature = "test_feature")]
  13. #![feature(staged_api)]
  14. #![staged_api]
  15. pub fn unstable() {}
  16. #[stable(feature = "rust1", since = "1.0.0")]
  17. pub fn stable() {}
  18. #[stable(feature = "rust1", since = "1.0.0")]
  19. pub mod stable_mod {
  20. pub fn unstable() {}
  21. #[stable(feature = "rust1", since = "1.0.0")]
  22. pub fn stable() {}
  23. }
  24. #[unstable(feature = "test_feature")]
  25. pub mod unstable_mod {
  26. #[stable(feature = "test_feature", since = "1.0.0")]
  27. #[deprecated(since = "1.0.0")]
  28. pub fn deprecated() {}
  29. pub fn unstable() {}
  30. }
  31. #[stable(feature = "rust1", since = "1.0.0")]
  32. pub trait Stable {
  33. fn unstable(&self);
  34. #[stable(feature = "rust1", since = "1.0.0")]
  35. fn stable(&self);
  36. }
  37. impl Stable for usize {
  38. fn unstable(&self) {}
  39. fn stable(&self) {}
  40. }
  41. pub enum Unstable {
  42. UnstableVariant,
  43. #[stable(feature = "rust1", since = "1.0.0")]
  44. StableVariant
  45. }