]> git.lizzy.rs Git - rust.git/blob - tests/rustdoc/doc-cfg-traits.rs
Rollup merge of #107169 - albertlarsan68:lock-in-pre-push, r=Mark-Simulacrum
[rust.git] / tests / rustdoc / doc-cfg-traits.rs
1 #![crate_name = "myrmecophagous"]
2 #![feature(doc_cfg, associated_type_defaults)]
3
4 // @has 'myrmecophagous/index.html'
5 // @count   - '//*[@class="stab portability"]' 2
6 // @matches - '//*[@class="stab portability"]' '^jurisconsult$'
7 // @matches - '//*[@class="stab portability"]' '^quarter$'
8
9 pub trait Lea {}
10
11 // @has 'myrmecophagous/trait.Vortoscope.html'
12 // @count   - '//*[@class="stab portability"]' 6
13 // @matches - '//*[@class="stab portability"]' 'crate feature zibib'
14 // @matches - '//*[@class="stab portability"]' 'crate feature poriform'
15 // @matches - '//*[@class="stab portability"]' 'crate feature ethopoeia'
16 // @matches - '//*[@class="stab portability"]' 'crate feature lea'
17 // @matches - '//*[@class="stab portability"]' 'crate feature unit'
18 // @matches - '//*[@class="stab portability"]' 'crate feature quarter'
19 pub trait Vortoscope {
20     type Batology = ();
21
22     #[doc(cfg(feature = "zibib"))]
23     type Zibib = ();
24
25     const YAHRZEIT: () = ();
26
27     #[doc(cfg(feature = "poriform"))]
28     const PORIFORM: () = ();
29
30     fn javanais() {}
31
32     #[doc(cfg(feature = "ethopoeia"))]
33     fn ethopoeia() {}
34 }
35
36 #[doc(cfg(feature = "lea"))]
37 impl<T: Lea> Vortoscope for T {}
38
39 #[doc(cfg(feature = "unit"))]
40 impl Vortoscope for () {}
41
42 // @has 'myrmecophagous/trait.Jurisconsult.html'
43 // @count   - '//*[@class="stab portability"]' 7
44 // @matches - '//*[@class="stab portability"]' 'crate feature jurisconsult'
45 // @matches - '//*[@class="stab portability"]' 'crate feature lithomancy'
46 // @matches - '//*[@class="stab portability"]' 'crate feature boodle'
47 // @matches - '//*[@class="stab portability"]' 'crate feature mistetch'
48 // @matches - '//*[@class="stab portability"]' 'crate feature lea'
49 // @matches - '//*[@class="stab portability"]' 'crate feature unit'
50 // @matches - '//*[@class="stab portability"]' 'crate feature quarter'
51 #[doc(cfg(feature = "jurisconsult"))]
52 pub trait Jurisconsult {
53     type Urbanist = ();
54
55     #[doc(cfg(feature = "lithomancy"))]
56     type Lithomancy = ();
57
58     const UNIFILAR: () = ();
59
60     #[doc(cfg(feature = "boodle"))]
61     const BOODLE: () = ();
62
63     fn mersion() {}
64
65     #[doc(cfg(feature = "mistetch"))]
66     fn mistetch() {}
67 }
68
69 #[doc(cfg(feature = "lea"))]
70 impl<T: Lea> Jurisconsult for T {}
71
72 #[doc(cfg(feature = "unit"))]
73 impl Jurisconsult for () {}
74
75 // @has 'myrmecophagous/struct.Ultimogeniture.html'
76 // @count   - '//*[@class="stab portability"]' 8
77 //
78 // @matches - '//*[@class="stab portability"]' 'crate feature zibib'
79 // @matches - '//*[@class="stab portability"]' 'crate feature poriform'
80 // @matches - '//*[@class="stab portability"]' 'crate feature ethopoeia'
81 //
82 // @matches - '//*[@class="stab portability"]' 'crate feature jurisconsult'
83 // @matches - '//*[@class="stab portability"]' 'crate feature lithomancy'
84 // @matches - '//*[@class="stab portability"]' 'crate feature boodle'
85 // @matches - '//*[@class="stab portability"]' 'crate feature mistetch'
86 //
87 // @matches - '//*[@class="stab portability"]' 'crate feature copy'
88 #[derive(Clone)]
89 pub struct Ultimogeniture;
90
91 impl Vortoscope for Ultimogeniture {}
92
93 #[doc(cfg(feature = "jurisconsult"))]
94 impl Jurisconsult for Ultimogeniture {}
95
96 #[doc(cfg(feature = "copy"))]
97 impl Copy for Ultimogeniture {}
98
99 // @has 'myrmecophagous/struct.Quarter.html'
100 // @count   - '//*[@class="stab portability"]' 9
101 // @matches - '//*[@class="stab portability"]' 'crate feature quarter'
102 //
103 // @matches - '//*[@class="stab portability"]' 'crate feature zibib'
104 // @matches - '//*[@class="stab portability"]' 'crate feature poriform'
105 // @matches - '//*[@class="stab portability"]' 'crate feature ethopoeia'
106 //
107 // @matches - '//*[@class="stab portability"]' 'crate feature jurisconsult'
108 // @matches - '//*[@class="stab portability"]' 'crate feature lithomancy'
109 // @matches - '//*[@class="stab portability"]' 'crate feature boodle'
110 // @matches - '//*[@class="stab portability"]' 'crate feature mistetch'
111 //
112 // @matches - '//*[@class="stab portability"]' 'crate feature copy'
113 #[doc(cfg(feature = "quarter"))]
114 #[derive(Clone)]
115 pub struct Quarter;
116
117 #[doc(cfg(feature = "quarter"))]
118 impl Vortoscope for Quarter {}
119
120 #[doc(cfg(all(feature = "jurisconsult", feature = "quarter")))]
121 impl Jurisconsult for Quarter {}
122
123 #[doc(cfg(all(feature = "copy", feature = "quarter")))]
124 impl Copy for Quarter {}