about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2022-12-14 12:46:08 +0000
committerbors <bors@rust-lang.org>2022-12-14 12:46:08 +0000
commitba64ba8b0dfd57f7d6d7399d0df7ded37d2af18d (patch)
tree37f9ba9fabdcb14e3983023722e8dfc16098eac6 /src
parent7bdda8f801818c1e9455725a964a3fa4f02c2bb8 (diff)
parentb6d140e2509092dc0a9877a4014d6dbe7956eabe (diff)
downloadrust-ba64ba8b0dfd57f7d6d7399d0df7ded37d2af18d.tar.gz
rust-ba64ba8b0dfd57f7d6d7399d0df7ded37d2af18d.zip
Auto merge of #105690 - matthiaskrgr:rollup-khtq97k, r=matthiaskrgr
Rollup of 6 pull requests

Successful merges:

 - #105642 (Minor grammar nit.)
 - #105658 (Remove ..X from RELEASES.md)
 - #105663 (Adjust log line in `fuchsia-test-runner.py`)
 - #105664 (rustdoc: apply `pre-wrap` CSS to code-wrapped links)
 - #105665 (rustdoc: simplify popover CSS)
 - #105676 (rustdoc: add CSS margin between `impl` docblock and its items)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'src')
-rwxr-xr-xsrc/ci/docker/scripts/fuchsia-test-runner.py2
-rw-r--r--src/librustdoc/html/static/css/rustdoc.css14
-rw-r--r--src/test/rustdoc-gui/docblock-big-code-mobile.goml4
-rw-r--r--src/test/rustdoc-gui/impl-doc.goml9
-rw-r--r--src/test/rustdoc-gui/src/test_docs/lib.rs13
5 files changed, 33 insertions, 9 deletions
diff --git a/src/ci/docker/scripts/fuchsia-test-runner.py b/src/ci/docker/scripts/fuchsia-test-runner.py
index a2708d16947..3e86339859d 100755
--- a/src/ci/docker/scripts/fuchsia-test-runner.py
+++ b/src/ci/docker/scripts/fuchsia-test-runner.py
@@ -346,7 +346,7 @@ class TestEnvironment:
                 "-f",
                 self.ssh_keyfile_path(),
                 "-C",
-                "Generated by test_toolchain.py",
+                "Generated by fuchsia-test-runner.py",
             ],
             stdout=self.subprocess_output(),
             stderr=self.subprocess_output(),
diff --git a/src/librustdoc/html/static/css/rustdoc.css b/src/librustdoc/html/static/css/rustdoc.css
index d22d2f2edb0..c485ac9ddb8 100644
--- a/src/librustdoc/html/static/css/rustdoc.css
+++ b/src/librustdoc/html/static/css/rustdoc.css
@@ -585,8 +585,8 @@ ul.block, .block li {
 	text-overflow: ellipsis;
 }
 /* Wrap non-pre code blocks (`text`) but not (```text```). */
-.docblock > :not(pre) > code,
-.docblock-short > code {
+.docblock :not(pre) > code,
+.docblock-short code {
 	white-space: pre-wrap;
 }
 
@@ -902,10 +902,11 @@ so that we can apply CSS-filters to change the arrow color in themes */
 	top: 100%;
 	right: 0;
 	z-index: 2;
-	display: block;
 	margin-top: 7px;
 	border-radius: 3px;
 	border: 1px solid var(--border-color);
+	background-color: var(--main-background-color);
+	color: var(--main-color);
 	--popover-arrow-offset: 11px;
 }
 
@@ -916,16 +917,12 @@ so that we can apply CSS-filters to change the arrow color in themes */
 	right: var(--popover-arrow-offset);
 	border: solid var(--border-color);
 	border-width: 1px 1px 0 0;
+	background-color: var(--main-background-color);
 	padding: 4px;
 	transform: rotate(-45deg);
 	top: -5px;
 }
 
-.popover, .popover::before {
-	background-color: var(--main-background-color);
-	color: var(--main-color);
-}
-
 /* use larger max-width for help popover, but not for help.html */
 #help.popover {
 	max-width: 600px;
@@ -1872,6 +1869,7 @@ in storage.js
 }
 
 .variants > .docblock,
+.implementors-toggle > .docblock,
 .impl-items > .rustdoc-toggle[open]:not(:last-child),
 .methods > .rustdoc-toggle[open]:not(:last-child),
 .implementors-toggle[open]:not(:last-child) {
diff --git a/src/test/rustdoc-gui/docblock-big-code-mobile.goml b/src/test/rustdoc-gui/docblock-big-code-mobile.goml
index 9f8df44d762..3ce921c2c91 100644
--- a/src/test/rustdoc-gui/docblock-big-code-mobile.goml
+++ b/src/test/rustdoc-gui/docblock-big-code-mobile.goml
@@ -7,3 +7,7 @@ show-text: true // We need to enable text draw to be able to have the "real" siz
 // Little explanations for this test: if the text wasn't displayed on two lines, it would take
 // around 20px (which is the font size).
 assert-property: (".docblock p > code", {"offsetHeight": "44"})
+
+// Same check, but where the long code block is also a link
+goto: "file://" + |DOC_PATH| + "/test_docs/long_code_block_link/index.html"
+assert-property: (".docblock p > a > code", {"offsetHeight": "44"})
diff --git a/src/test/rustdoc-gui/impl-doc.goml b/src/test/rustdoc-gui/impl-doc.goml
new file mode 100644
index 00000000000..7322032b3f5
--- /dev/null
+++ b/src/test/rustdoc-gui/impl-doc.goml
@@ -0,0 +1,9 @@
+// A docblock on an impl must have a margin to separate it from the contents.
+goto: "file://" + |DOC_PATH| + "/test_docs/struct.TypeWithImplDoc.html"
+
+// The text is about 24px tall, so if there's a margin, then their position will be >24px apart
+compare-elements-position-near-false: (
+	"#implementations-list > .implementors-toggle > .docblock > p",
+	"#implementations-list > .implementors-toggle > .impl-items",
+	{"y": 24}
+)
diff --git a/src/test/rustdoc-gui/src/test_docs/lib.rs b/src/test/rustdoc-gui/src/test_docs/lib.rs
index d6eeab803df..f1b69d4dc1d 100644
--- a/src/test/rustdoc-gui/src/test_docs/lib.rs
+++ b/src/test/rustdoc-gui/src/test_docs/lib.rs
@@ -154,6 +154,11 @@ pub mod huge_amount_of_consts {
 /// Very long code text `hereIgoWithLongTextBecauseWhyNotAndWhyWouldntI`.
 pub mod long_code_block {}
 
+/// Very long code text [`hereIgoWithLongTextBecauseWhyNotAndWhyWouldntI`][lnk].
+///
+/// [lnk]: crate::long_code_block_link
+pub mod long_code_block_link {}
+
 #[macro_export]
 macro_rules! repro {
     () => {};
@@ -442,3 +447,11 @@ pub mod trait_members {
         fn function2() {}
     }
 }
+
+pub struct TypeWithImplDoc;
+
+/// impl doc
+impl TypeWithImplDoc {
+    /// fn doc
+    pub fn test_fn() {}
+}