/src/test/rustdoc/deprecated-impls.rs

https://gitlab.com/jianglu/rust · Rust · 128 lines · 36 code · 24 blank · 68 comment · 2 complexity · 56a3c118d7fcc26f8122c3e09c0e6d8b MD5 · raw file

  1. // Copyright 2015 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 = "foo"]
  11. // @has foo/struct.Foo0.html
  12. pub struct Foo0;
  13. impl Foo0 {
  14. // @has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.1: fn_with_doc'
  15. // @has - 'fn_with_doc short'
  16. // @has - 'fn_with_doc full'
  17. /// fn_with_doc short
  18. ///
  19. /// fn_with_doc full
  20. #[deprecated(since = "1.0.1", note = "fn_with_doc")]
  21. pub fn fn_with_doc() {}
  22. // @has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.2: fn_without_doc'
  23. #[deprecated(since = "1.0.2", note = "fn_without_doc")]
  24. pub fn fn_without_doc() {}
  25. }
  26. pub trait Bar {
  27. /// fn_empty_with_doc short
  28. ///
  29. /// fn_empty_with_doc full
  30. #[deprecated(since = "1.0.3", note = "fn_empty_with_doc")]
  31. fn fn_empty_with_doc();
  32. #[deprecated(since = "1.0.4", note = "fn_empty_without_doc")]
  33. fn fn_empty_without_doc();
  34. /// fn_def_with_doc short
  35. ///
  36. /// fn_def_with_doc full
  37. #[deprecated(since = "1.0.5", note = "fn_def_with_doc")]
  38. fn fn_def_with_doc() {}
  39. #[deprecated(since = "1.0.6", note = "fn_def_without_doc")]
  40. fn fn_def_without_doc() {}
  41. /// fn_def_def_with_doc short
  42. ///
  43. /// fn_def_def_with_doc full
  44. #[deprecated(since = "1.0.7", note = "fn_def_def_with_doc")]
  45. fn fn_def_def_with_doc() {}
  46. #[deprecated(since = "1.0.8", note = "fn_def_def_without_doc")]
  47. fn fn_def_def_without_doc() {}
  48. }
  49. // @has foo/struct.Foo1.html
  50. pub struct Foo1;
  51. impl Bar for Foo1 {
  52. // @has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.3: fn_empty_with_doc'
  53. // @has - 'fn_empty_with_doc_impl short'
  54. // @has - 'fn_empty_with_doc_impl full'
  55. /// fn_empty_with_doc_impl short
  56. ///
  57. /// fn_empty_with_doc_impl full
  58. fn fn_empty_with_doc() {}
  59. // @has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.4: fn_empty_without_doc'
  60. fn fn_empty_without_doc() {}
  61. // @has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.5: fn_def_with_doc'
  62. // @has - 'fn_def_with_doc_impl short'
  63. // @has - 'fn_def_with_doc_impl full'
  64. /// fn_def_with_doc_impl short
  65. ///
  66. /// fn_def_with_doc_impl full
  67. fn fn_def_with_doc() {}
  68. // @has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.6: fn_def_without_doc'
  69. fn fn_def_without_doc() {}
  70. // @has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.7: fn_def_def_with_doc'
  71. // @has - 'fn_def_def_with_doc short'
  72. // @!has - 'fn_def_def_with_doc full'
  73. // @has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.8: fn_def_def_without_doc'
  74. }
  75. // @has foo/struct.Foo2.html
  76. pub struct Foo2;
  77. impl Bar for Foo2 {
  78. // @has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.3: fn_empty_with_doc'
  79. // @has - 'fn_empty_with_doc short'
  80. // @!has - 'fn_empty_with_doc full'
  81. fn fn_empty_with_doc() {}
  82. // @has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.4: fn_empty_without_doc'
  83. // @has - 'fn_empty_without_doc_impl short'
  84. // @has - 'fn_empty_without_doc_impl full'
  85. /// fn_empty_without_doc_impl short
  86. ///
  87. /// fn_empty_without_doc_impl full
  88. fn fn_empty_without_doc() {}
  89. // @has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.5: fn_def_with_doc'
  90. // @has - 'fn_def_with_doc short'
  91. // @!has - 'fn_def_with full'
  92. fn fn_def_with_doc() {}
  93. // @has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.6: fn_def_without_doc'
  94. // @has - 'fn_def_without_doc_impl short'
  95. // @has - 'fn_def_without_doc_impl full'
  96. /// fn_def_without_doc_impl short
  97. ///
  98. /// fn_def_without_doc_impl full
  99. fn fn_def_without_doc() {}
  100. // @has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.7: fn_def_def_with_doc'
  101. // @has - 'fn_def_def_with_doc short'
  102. // @!has - 'fn_def_def_with_doc full'
  103. // @has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.8: fn_def_def_without_doc'
  104. }