about summary refs log tree commit diff
path: root/src/test/rustdoc
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2021-05-18 14:08:42 +0200
committerGitHub <noreply@github.com>2021-05-18 14:08:42 +0200
commitd151ed869999f92b8a192f898197e5ad3e47e438 (patch)
treeee15c1be5c8fa122950515855c81aa2a87427700 /src/test/rustdoc
parent07d11cf95c87e788c69783611a64bb2365d9447d (diff)
parent6696a60f0f04e1b7e78927f5747c1080f5189370 (diff)
downloadrust-d151ed869999f92b8a192f898197e5ad3e47e438.tar.gz
rust-d151ed869999f92b8a192f898197e5ad3e47e438.zip
Rollup merge of #85280 - jsha:move-trait-toggles, r=GuillaumeGomez
Toggle-wrap items differently than top-doc.

This makes sure things like trait methods get wrapped at the
`<h3><code>` level rather than at the `.docblock` level. Also it ensures
that only the actual top documentation gets the `.top-doc` class.

Fixes #85167

Before:

![image](https://user-images.githubusercontent.com/220205/117743384-98790200-b1bb-11eb-8804-588530842514.png)

https://doc.rust-lang.org/nightly/std/io/trait.Read.html#tymethod.read

After:

![image](https://user-images.githubusercontent.com/220205/118410882-98a75080-b646-11eb-949d-ca688bab6923.png)
Diffstat (limited to 'src/test/rustdoc')
-rw-r--r--src/test/rustdoc/toggle-trait-fn.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/test/rustdoc/toggle-trait-fn.rs b/src/test/rustdoc/toggle-trait-fn.rs
new file mode 100644
index 00000000000..a160809cbf9
--- /dev/null
+++ b/src/test/rustdoc/toggle-trait-fn.rs
@@ -0,0 +1,7 @@
+#![crate_name = "foo"]
+
+// @has foo/trait.Foo.html
+// @has - '//details[@class="rustdoc-toggle"]//code' 'bar'
+pub trait Foo {
+    fn bar() -> ();
+}