]> git.proxmox.com Git - rustc.git/blob - src/test/rustdoc/issue-89309-heading-levels.rs
New upstream version 1.57.0+dfsg1
[rustc.git] / src / test / 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 }