]> git.lizzy.rs Git - rust.git/blob - src/test/rustdoc/item-hide-threshold.rs
Rollup merge of #84464 - jyn514:type-kind, r=CraftSpider
[rust.git] / src / test / rustdoc / item-hide-threshold.rs
1 #![allow(unused)]
2
3 // @has 'item_hide_threshold/struct.PubStruct.html'
4 // @count - '//details[@class="rustdoc-toggle type-contents-toggle"]' 0
5 pub struct PubStruct {
6     pub a: usize,
7     pub b: usize,
8 }
9
10 // @has 'item_hide_threshold/struct.BigPubStruct.html'
11 // @count - '//details[@class="rustdoc-toggle type-contents-toggle"]' 1
12 // @has - '//details[@class="rustdoc-toggle type-contents-toggle"]' 'Show fields'
13 pub struct BigPubStruct {
14     pub a: usize,
15     pub b: usize,
16     pub c: usize,
17     pub d: usize,
18     pub e: usize,
19     pub f: usize,
20     pub g: usize,
21     pub h: usize,
22     pub i: usize,
23     pub j: usize,
24     pub k: usize,
25     pub l: usize,
26     pub m: usize,
27 }
28
29 // @has 'item_hide_threshold/union.BigUnion.html'
30 // @count - '//details[@class="rustdoc-toggle type-contents-toggle"]' 1
31 // @has - '//details[@class="rustdoc-toggle type-contents-toggle"]' 'Show fields'
32 pub union BigUnion {
33     pub a: usize,
34     pub b: usize,
35     pub c: usize,
36     pub d: usize,
37     pub e: usize,
38     pub f: usize,
39     pub g: usize,
40     pub h: usize,
41     pub i: usize,
42     pub j: usize,
43     pub k: usize,
44     pub l: usize,
45     pub m: usize,
46 }
47
48 // @has 'item_hide_threshold/union.Union.html'
49 // @count - '//details[@class="rustdoc-toggle type-contents-toggle"]' 0
50 pub union Union {
51     pub a: usize,
52     pub b: usize,
53     pub c: usize,
54 }
55
56 // @has 'item_hide_threshold/struct.PrivStruct.html'
57 // @count - '//details[@class="rustdoc-toggle type-contents-toggle"]' 0
58 // @has - '//div[@class="docblock type-decl"]' 'fields omitted'
59 pub struct PrivStruct {
60     a: usize,
61     b: usize,
62 }
63
64 // @has 'item_hide_threshold/enum.Enum.html'
65 // @count - '//details[@class="rustdoc-toggle type-contents-toggle"]' 1
66 // @has - '//details[@class="rustdoc-toggle type-contents-toggle"]' 'Show fields'
67 pub enum Enum {
68     A, B, C,
69     D {
70         a: u8,
71         b: u8
72     }
73 }
74
75 // @has 'item_hide_threshold/enum.LargeEnum.html'
76 // @count - '//details[@class="rustdoc-toggle type-contents-toggle"]' 1
77 // @has - '//details[@class="rustdoc-toggle type-contents-toggle"]' 'Show variants'
78 pub enum LargeEnum {
79     A, B, C, D, E, F(u8), G, H, I, J, K, L, M
80 }
81
82 // @has 'item_hide_threshold/trait.Trait.html'
83 // @count - '//details[@class="rustdoc-toggle type-contents-toggle"]' 0
84 pub trait Trait {
85     type A;
86     #[must_use]
87     fn foo();
88     fn bar();
89 }
90
91 // @has 'item_hide_threshold/trait.GinormousTrait.html'
92 // @count - '//details[@class="rustdoc-toggle type-contents-toggle"]' 1
93 // @has - '//details[@class="rustdoc-toggle type-contents-toggle"]' 'Show associated items'
94 pub trait GinormousTrait {
95     type A;
96     type B;
97     type C;
98     type D;
99     type E;
100     type F;
101     type G;
102     type H;
103     type I;
104     type J;
105     type K;
106     type L;
107     type M;
108     const N: usize = 1;
109     #[must_use]
110     fn foo();
111     fn bar();
112 }
113
114 // @has 'item_hide_threshold/trait.HugeTrait.html'
115 // @count - '//details[@class="rustdoc-toggle type-contents-toggle"]' 1
116 // @has - '//details[@class="rustdoc-toggle type-contents-toggle"]' 'Show associated constants and methods'
117 pub trait HugeTrait {
118     type A;
119     const M: usize = 1;
120     const N: usize = 1;
121     const O: usize = 1;
122     const P: usize = 1;
123     const Q: usize = 1;
124     const R: usize = 1;
125     const S: usize = 1;
126     const T: usize = 1;
127     const U: usize = 1;
128     const V: usize = 1;
129     const W: usize = 1;
130     const X: usize = 1;
131     #[must_use]
132     fn foo();
133     fn bar();
134 }
135
136 // @has 'item_hide_threshold/trait.BigTrait.html'
137 // @count - '//details[@class="rustdoc-toggle type-contents-toggle"]' 1
138 // @has - '//details[@class="rustdoc-toggle type-contents-toggle"]' 'Show methods'
139 pub trait BigTrait {
140     type A;
141     #[must_use]
142     fn foo();
143     fn bar();
144     fn baz();
145     fn quux();
146     fn frob();
147     fn greeble();
148     fn blap();
149     fn whoop();
150     fn pow();
151     fn bang();
152     fn oomph();
153     fn argh();
154     fn wap();
155     fn ouch();
156 }