]> git.lizzy.rs Git - rust.git/blob - tests/rustdoc/issue-89309-heading-levels.rs
Rollup merge of #107819 - clubby789:x-py-root, r=jyn514
[rust.git] / tests / rustdoc / issue-89309-heading-levels.rs
1 #![crate_name = "foo"]
2
3 // @has foo/trait.Read.html
4 // @has - '//h2' 'Trait examples'
5 /// # Trait examples
6 pub trait Read {
7     // @has - '//h5' 'Function examples'
8     /// # Function examples
9     fn read(&mut self, buf: &mut [u8]) -> Result<usize, ()>;
10 }
11
12 pub struct Foo;
13
14 // @has foo/struct.Foo.html
15 impl Foo {
16     // @has - '//h5' 'Implementation header'
17     /// # Implementation header
18     pub fn bar(&self) -> usize {
19         1
20     }
21 }
22
23 impl Read for Foo {
24     // @has - '//h5' 'Trait implementation header'
25     /// # Trait implementation header
26     fn read(&mut self, buf: &mut [u8]) -> Result<usize, ()> {
27         Ok(1)
28     }
29 }