]> git.lizzy.rs Git - rust.git/blob - tests/rustdoc/toggle-method.rs
Rollup merge of #106958 - jyn514:labels, r=m-ou-se
[rust.git] / tests / rustdoc / toggle-method.rs
1 #![crate_name = "foo"]
2
3 // Struct methods with documentation should be wrapped in a <details> toggle with an appropriate
4 // summary. Struct methods with no documentation should not be wrapped.
5 //
6 // @has foo/struct.Foo.html
7 // @has - '//details[@class="toggle method-toggle"]//summary//h4[@class="code-header"]' 'is_documented()'
8 // @has - '//details[@class="toggle method-toggle"]//*[@class="docblock"]' 'is_documented is documented'
9 // @!has - '//details[@class="toggle method-toggle"]//summary//h4[@class="code-header"]' 'not_documented()'
10 pub struct Foo {
11 }
12
13 impl Foo {
14     pub fn not_documented() {}
15
16     /// is_documented is documented
17     pub fn is_documented() {}
18 }