Skip to content

Commit d4bd059

Browse files
authored
Rollup merge of #101046 - notriddle:notriddle/table-css, r=jsha
rustdoc: remove incorrect CSS selector `.impl-items table td` Fixes #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).
2 parents 5fea6a0 + 25eb52f commit d4bd059

File tree

3 files changed

+31
-1
lines changed

3 files changed

+31
-1
lines changed

src/librustdoc/html/static/css/rustdoc.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -777,7 +777,7 @@ pre, .rustdoc.source .example-wrap {
777777
.content .docblock >.impl-items table td {
778778
padding: 0;
779779
}
780-
.content .docblock > .impl-items .table-display, .impl-items table td {
780+
.content .docblock > .impl-items .table-display {
781781
border: none;
782782
}
783783

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
goto: file://|DOC_PATH|/test_docs/doc_block_table/struct.DocBlockTable.html#method.func
2+
3+
compare-elements-css: (".impl-items .docblock table th", ".top-doc .docblock table th", ["border"])
4+
compare-elements-css: (".impl-items .docblock table td", ".top-doc .docblock table td", ["border"])

src/test/rustdoc-gui/src/test_docs/lib.rs

+26
Original file line numberDiff line numberDiff line change
@@ -293,3 +293,29 @@ pub mod details {
293293
/// </details>
294294
pub struct Details;
295295
}
296+
297+
pub mod doc_block_table {
298+
299+
pub trait DocBlockTableTrait {
300+
fn func();
301+
}
302+
303+
/// Struct doc.
304+
///
305+
/// | header1 | header2 |
306+
/// |--------------------------|--------------------------|
307+
/// | Lorem Ipsum, Lorem Ipsum | Lorem Ipsum, Lorem Ipsum |
308+
pub struct DocBlockTable {}
309+
310+
impl DocBlockTableTrait for DocBlockTable {
311+
/// Trait impl func doc for struct.
312+
///
313+
/// | header1 | header2 |
314+
/// |--------------------------|--------------------------|
315+
/// | Lorem Ipsum, Lorem Ipsum | Lorem Ipsum, Lorem Ipsum |
316+
fn func() {
317+
println!();
318+
}
319+
}
320+
321+
}

0 commit comments

Comments
 (0)