blob: d97d5b4a96882805c47df8f7d9b1ed7748454d31 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
|
// Test to ensure that the `--document-hidden-items` option is working as expected.
// compile-flags: -Z unstable-options --document-hidden-items
// ignore-tidy-linelength
#![crate_name = "foo"]
// @has 'foo/index.html'
// @has - '//*[@id="reexport.hidden_reexport"]/code' 'pub use hidden::inside_hidden as hidden_reexport;'
#[doc(hidden)]
pub use hidden::inside_hidden as hidden_reexport;
// @has - '//*[@class="item-name"]/a[@class="trait"]' 'TraitHidden'
// @has 'foo/trait.TraitHidden.html'
#[doc(hidden)]
pub trait TraitHidden {}
// @has 'foo/index.html' '//*[@class="item-name"]/a[@class="trait"]' 'Trait'
pub trait Trait {
// @has 'foo/trait.Trait.html'
// @has - '//*[@id="associatedconstant.BAR"]/*[@class="code-header"]' 'const BAR: u32 = 0u32'
#[doc(hidden)]
const BAR: u32 = 0;
// @has - '//*[@id="method.foo"]/*[@class="code-header"]' 'fn foo()'
#[doc(hidden)]
fn foo() {}
}
// @has 'foo/index.html' '//*[@class="item-name"]/a[@class="struct"]' 'Struct'
// @has 'foo/struct.Struct.html'
pub struct Struct {
// @has - '//*[@id="structfield.a"]/code' 'a: u32'
#[doc(hidden)]
pub a: u32,
}
impl Struct {
// @has - '//*[@id="method.new"]/*[@class="code-header"]' 'pub fn new() -> Self'
#[doc(hidden)]
pub fn new() -> Self { Self { a: 0 } }
}
impl Trait for Struct {
// @has - '//*[@id="associatedconstant.BAR"]/*[@class="code-header"]' 'const BAR: u32 = 0u32'
// @has - '//*[@id="method.foo"]/*[@class="code-header"]' 'fn foo()'
}
// @has - '//*[@id="impl-TraitHidden-for-Struct"]/*[@class="code-header"]' 'impl TraitHidden for Struct'
impl TraitHidden for Struct {}
// @has 'foo/index.html' '//*[@class="item-name"]/a[@class="enum"]' 'HiddenEnum'
// @has 'foo/enum.HiddenEnum.html'
#[doc(hidden)]
pub enum HiddenEnum {
A,
}
// @has 'foo/index.html' '//*[@class="item-name"]/a[@class="enum"]' 'Enum'
pub enum Enum {
// @has 'foo/enum.Enum.html' '//*[@id="variant.A"]/*[@class="code-header"]' 'A'
#[doc(hidden)]
A,
}
// @has 'foo/index.html' '//*[@class="item-name"]/a[@class="mod"]' 'hidden'
#[doc(hidden)]
pub mod hidden {
// @has 'foo/hidden/index.html'
// @has - '//*[@class="item-name"]/a[@class="fn"]' 'inside_hidden'
// @has 'foo/hidden/fn.inside_hidden.html'
pub fn inside_hidden() {}
}
|