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

https://gitlab.com/rust-lang/rust · Rust · 118 lines · 36 code · 23 blank · 59 comment · 2 complexity · e458492fd298e8ab3a3e7cbcb29b9b77 MD5 · raw file

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