Skip to content

Commit

Permalink
Rollup merge of rust-lang#101046 - notriddle:notriddle/table-css, r=jsha
Browse files Browse the repository at this point in the history
rustdoc: remove incorrect CSS selector `.impl-items table td`

Fixes rust-lang#100994

This selector was added in c7312fb. The bug can be seen at <https://doc.rust-lang.org/1.27.0/alloc/slice/trait.SliceIndex.html#foreign-impls>.

This rule was added to help with a `<table>` that was used for displaying the function signature [src] lockup. That lockup was changed in 34bd2b8 to use flexbox instead, leaving this selector unused (at least, for its original purpose).
  • Loading branch information
Dylan-DPC committed Aug 26, 2022
2 parents 5fea6a0 + 25eb52f commit d4bd059
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/librustdoc/html/static/css/rustdoc.css
Original file line number Diff line number Diff line change
Expand Up @@ -777,7 +777,7 @@ pre, .rustdoc.source .example-wrap {
.content .docblock >.impl-items table td {
padding: 0;
}
.content .docblock > .impl-items .table-display, .impl-items table td {
.content .docblock > .impl-items .table-display {
border: none;
}

Expand Down
4 changes: 4 additions & 0 deletions src/test/rustdoc-gui/docblock-table.goml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
goto: file://|DOC_PATH|/test_docs/doc_block_table/struct.DocBlockTable.html#method.func

compare-elements-css: (".impl-items .docblock table th", ".top-doc .docblock table th", ["border"])
compare-elements-css: (".impl-items .docblock table td", ".top-doc .docblock table td", ["border"])
26 changes: 26 additions & 0 deletions src/test/rustdoc-gui/src/test_docs/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -293,3 +293,29 @@ pub mod details {
/// </details>
pub struct Details;
}

pub mod doc_block_table {

pub trait DocBlockTableTrait {
fn func();
}

/// Struct doc.
///
/// | header1 | header2 |
/// |--------------------------|--------------------------|
/// | Lorem Ipsum, Lorem Ipsum | Lorem Ipsum, Lorem Ipsum |
pub struct DocBlockTable {}

impl DocBlockTableTrait for DocBlockTable {
/// Trait impl func doc for struct.
///
/// | header1 | header2 |
/// |--------------------------|--------------------------|
/// | Lorem Ipsum, Lorem Ipsum | Lorem Ipsum, Lorem Ipsum |
fn func() {
println!();
}
}

}

0 comments on commit d4bd059

Please sign in to comment.