]> git.lizzy.rs Git - rust.git/blob - tests/rustdoc/hidden-trait-methods.rs
Auto merge of #107778 - weihanglo:update-cargo, r=weihanglo
[rust.git] / tests / rustdoc / hidden-trait-methods.rs
1 // test for trait methods with `doc(hidden)`.
2 #![crate_name = "foo"]
3
4 // @has foo/trait.Trait.html
5 // @!has - '//*[@id="associatedtype.Foo"]' 'type Foo'
6 // @has - '//*[@id="associatedtype.Bar"]' 'type Bar'
7 // @!has - '//*[@id="tymethod.f"]' 'fn f()'
8 // @has - '//*[@id="tymethod.g"]' 'fn g()'
9 pub trait Trait {
10     #[doc(hidden)]
11     type Foo;
12     type Bar;
13     #[doc(hidden)]
14     fn f();
15     fn g();
16 }
17
18 // @has foo/struct.S.html
19 // @!has - '//*[@id="associatedtype.Foo"]' 'type Foo'
20 // @has - '//*[@id="associatedtype.Bar"]' 'type Bar'
21 // @!has - '//*[@id="method.f"]' 'fn f()'
22 // @has - '//*[@id="method.g"]' 'fn g()'
23 pub struct S;
24 impl Trait for S {
25     type Foo = ();
26     type Bar = ();
27     fn f() {}
28     fn g() {}
29 }