Skip to content

Commit

Permalink
Auto merge of rust-lang#105690 - matthiaskrgr:rollup-khtq97k, r=matth…
Browse files Browse the repository at this point in the history
…iaskrgr

Rollup of 6 pull requests

Successful merges:

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

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
  • Loading branch information
bors committed Dec 14, 2022
2 parents 7bdda8f + b6d140e commit ba64ba8
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 11 deletions.
2 changes: 1 addition & 1 deletion RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Language
- [Change constant evaluation errors from a deny-by-default lint to a hard error](https://github.com/rust-lang/rust/pull/102091/)
- [Trigger `must_use` on `impl Trait` for supertraits](https://github.com/rust-lang/rust/pull/102287/)
This makes `impl ExactSizeIterator` respect the existing `#[must_use]` annotation on `Iterator`.
- [Allow `..X` and `..=X` in patterns](https://github.com/rust-lang/rust/pull/102275/)
- [Allow `..=X` in patterns](https://github.com/rust-lang/rust/pull/102275/)
- [Uplift `clippy::for_loops_over_fallibles` lint into rustc](https://github.com/rust-lang/rust/pull/99696/)
- [Stabilize `sym` operands in inline assembly](https://github.com/rust-lang/rust/pull/103168/)
- [Update to Unicode 15](https://github.com/rust-lang/rust/pull/101912/)
Expand Down
2 changes: 1 addition & 1 deletion library/core/src/borrow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
/// to be modified, it can additionally implement [`BorrowMut<T>`].
///
/// Further, when providing implementations for additional traits, it needs
/// to be considered whether they should behave identical to those of the
/// to be considered whether they should behave identically to those of the
/// underlying type as a consequence of acting as a representation of that
/// underlying type. Generic code typically uses `Borrow<T>` when it relies
/// on the identical behavior of these additional trait implementations.
Expand Down
2 changes: 1 addition & 1 deletion src/ci/docker/scripts/fuchsia-test-runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ def start(self):
"-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(),
Expand Down
14 changes: 6 additions & 8 deletions src/librustdoc/html/static/css/rustdoc.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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;
}

Expand All @@ -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;
Expand Down Expand Up @@ -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) {
Expand Down
4 changes: 4 additions & 0 deletions src/test/rustdoc-gui/docblock-big-code-mobile.goml
Original file line number Diff line number Diff line change
Expand Up @@ -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"})
9 changes: 9 additions & 0 deletions src/test/rustdoc-gui/impl-doc.goml
Original file line number Diff line number Diff line change
@@ -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}
)
13 changes: 13 additions & 0 deletions src/test/rustdoc-gui/src/test_docs/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
() => {};
Expand Down Expand Up @@ -442,3 +447,11 @@ pub mod trait_members {
fn function2() {}
}
}

pub struct TypeWithImplDoc;

/// impl doc
impl TypeWithImplDoc {
/// fn doc
pub fn test_fn() {}
}

0 comments on commit ba64ba8

Please sign in to comment.