/src/test/rustdoc/doc-cfg-traits.rs

https://gitlab.com/rust-lang/rust · Rust · 124 lines · 50 code · 26 blank · 48 comment · 10 complexity · ee667c7563a7ffa698807e711abccf84 MD5 · raw file

  1. #![crate_name = "myrmecophagous"]
  2. #![feature(doc_cfg, associated_type_defaults)]
  3. // @has 'myrmecophagous/index.html'
  4. // @count - '//*[@class="stab portability"]' 2
  5. // @matches - '//*[@class="stab portability"]' '^jurisconsult$'
  6. // @matches - '//*[@class="stab portability"]' '^quarter$'
  7. pub trait Lea {}
  8. // @has 'myrmecophagous/trait.Vortoscope.html'
  9. // @count - '//*[@class="stab portability"]' 6
  10. // @matches - '//*[@class="stab portability"]' 'crate feature zibib'
  11. // @matches - '//*[@class="stab portability"]' 'crate feature poriform'
  12. // @matches - '//*[@class="stab portability"]' 'crate feature ethopoeia'
  13. // @matches - '//*[@class="stab portability"]' 'crate feature lea'
  14. // @matches - '//*[@class="stab portability"]' 'crate feature unit'
  15. // @matches - '//*[@class="stab portability"]' 'crate feature quarter'
  16. pub trait Vortoscope {
  17. type Batology = ();
  18. #[doc(cfg(feature = "zibib"))]
  19. type Zibib = ();
  20. const YAHRZEIT: () = ();
  21. #[doc(cfg(feature = "poriform"))]
  22. const PORIFORM: () = ();
  23. fn javanais() {}
  24. #[doc(cfg(feature = "ethopoeia"))]
  25. fn ethopoeia() {}
  26. }
  27. #[doc(cfg(feature = "lea"))]
  28. impl<T: Lea> Vortoscope for T {}
  29. #[doc(cfg(feature = "unit"))]
  30. impl Vortoscope for () {}
  31. // @has 'myrmecophagous/trait.Jurisconsult.html'
  32. // @count - '//*[@class="stab portability"]' 7
  33. // @matches - '//*[@class="stab portability"]' 'crate feature jurisconsult'
  34. // @matches - '//*[@class="stab portability"]' 'crate feature lithomancy'
  35. // @matches - '//*[@class="stab portability"]' 'crate feature boodle'
  36. // @matches - '//*[@class="stab portability"]' 'crate feature mistetch'
  37. // @matches - '//*[@class="stab portability"]' 'crate feature lea'
  38. // @matches - '//*[@class="stab portability"]' 'crate feature unit'
  39. // @matches - '//*[@class="stab portability"]' 'crate feature quarter'
  40. #[doc(cfg(feature = "jurisconsult"))]
  41. pub trait Jurisconsult {
  42. type Urbanist = ();
  43. #[doc(cfg(feature = "lithomancy"))]
  44. type Lithomancy = ();
  45. const UNIFILAR: () = ();
  46. #[doc(cfg(feature = "boodle"))]
  47. const BOODLE: () = ();
  48. fn mersion() {}
  49. #[doc(cfg(feature = "mistetch"))]
  50. fn mistetch() {}
  51. }
  52. #[doc(cfg(feature = "lea"))]
  53. impl<T: Lea> Jurisconsult for T {}
  54. #[doc(cfg(feature = "unit"))]
  55. impl Jurisconsult for () {}
  56. // @has 'myrmecophagous/struct.Ultimogeniture.html'
  57. // @count - '//*[@class="stab portability"]' 8
  58. //
  59. // @matches - '//*[@class="stab portability"]' 'crate feature zibib'
  60. // @matches - '//*[@class="stab portability"]' 'crate feature poriform'
  61. // @matches - '//*[@class="stab portability"]' 'crate feature ethopoeia'
  62. //
  63. // @matches - '//*[@class="stab portability"]' 'crate feature jurisconsult'
  64. // @matches - '//*[@class="stab portability"]' 'crate feature lithomancy'
  65. // @matches - '//*[@class="stab portability"]' 'crate feature boodle'
  66. // @matches - '//*[@class="stab portability"]' 'crate feature mistetch'
  67. //
  68. // @matches - '//*[@class="stab portability"]' 'crate feature copy'
  69. #[derive(Clone)]
  70. pub struct Ultimogeniture;
  71. impl Vortoscope for Ultimogeniture {}
  72. #[doc(cfg(feature = "jurisconsult"))]
  73. impl Jurisconsult for Ultimogeniture {}
  74. #[doc(cfg(feature = "copy"))]
  75. impl Copy for Ultimogeniture {}
  76. // @has 'myrmecophagous/struct.Quarter.html'
  77. // @count - '//*[@class="stab portability"]' 9
  78. // @matches - '//*[@class="stab portability"]' 'crate feature quarter'
  79. //
  80. // @matches - '//*[@class="stab portability"]' 'crate feature zibib'
  81. // @matches - '//*[@class="stab portability"]' 'crate feature poriform'
  82. // @matches - '//*[@class="stab portability"]' 'crate feature ethopoeia'
  83. //
  84. // @matches - '//*[@class="stab portability"]' 'crate feature jurisconsult'
  85. // @matches - '//*[@class="stab portability"]' 'crate feature lithomancy'
  86. // @matches - '//*[@class="stab portability"]' 'crate feature boodle'
  87. // @matches - '//*[@class="stab portability"]' 'crate feature mistetch'
  88. //
  89. // @matches - '//*[@class="stab portability"]' 'crate feature copy'
  90. #[doc(cfg(feature = "quarter"))]
  91. #[derive(Clone)]
  92. pub struct Quarter;
  93. #[doc(cfg(feature = "quarter"))]
  94. impl Vortoscope for Quarter {}
  95. #[doc(cfg(all(feature = "jurisconsult", feature = "quarter")))]
  96. impl Jurisconsult for Quarter {}
  97. #[doc(cfg(all(feature = "copy", feature = "quarter")))]
  98. impl Copy for Quarter {}