Skip to content

Commit

Permalink
Rollup merge of #105676 - notriddle:notriddle/impl-docblock, r=Guilla…
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiaskrgr authored Dec 14, 2022
2 parents 138c632 + 79bb6ec commit 6866cb7
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/librustdoc/html/static/css/rustdoc.css
Original file line number Diff line number Diff line change
Expand Up @@ -1869,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
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}
)
8 changes: 8 additions & 0 deletions src/test/rustdoc-gui/src/test_docs/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -447,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 6866cb7

Please sign in to comment.