about summary refs log tree commit diff
path: root/tests/rustdoc/heading-levels-89309.rs
diff options
context:
space:
mode:
authorMichael Howell <michael@notriddle.com>2024-05-21 12:28:34 -0700
committerMichael Howell <michael@notriddle.com>2024-05-21 12:28:34 -0700
commit55bd054a21533cbaa02836b0ca125c2eaaa4b8f4 (patch)
tree056ce446f62d15e616fb53cfbd90fd3aac1e8aff /tests/rustdoc/heading-levels-89309.rs
parent4486c24db3ca1c698b34ea08bee15194774b53df (diff)
downloadrust-55bd054a21533cbaa02836b0ca125c2eaaa4b8f4.tar.gz
rust-55bd054a21533cbaa02836b0ca125c2eaaa4b8f4.zip
rustdoc: rename `issue-\d+.rs` tests to have meaningful names
Diffstat (limited to 'tests/rustdoc/heading-levels-89309.rs')
-rw-r--r--tests/rustdoc/heading-levels-89309.rs30
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/rustdoc/heading-levels-89309.rs b/tests/rustdoc/heading-levels-89309.rs
new file mode 100644
index 00000000000..caa99428525
--- /dev/null
+++ b/tests/rustdoc/heading-levels-89309.rs
@@ -0,0 +1,30 @@
+// https://github.com/rust-lang/rust/issues/89309
+#![crate_name = "foo"]
+
+// @has foo/trait.Read.html
+// @has - '//h2' 'Trait examples'
+/// # Trait examples
+pub trait Read {
+    // @has - '//h5' 'Function examples'
+    /// # Function examples
+    fn read(&mut self, buf: &mut [u8]) -> Result<usize, ()>;
+}
+
+pub struct Foo;
+
+// @has foo/struct.Foo.html
+impl Foo {
+    // @has - '//h5' 'Implementation header'
+    /// # Implementation header
+    pub fn bar(&self) -> usize {
+        1
+    }
+}
+
+impl Read for Foo {
+    // @has - '//h5' 'Trait implementation header'
+    /// # Trait implementation header
+    fn read(&mut self, buf: &mut [u8]) -> Result<usize, ()> {
+        Ok(1)
+    }
+}