Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rustdoc: fix weird margins between Deref impl items #110964

Merged
merged 2 commits into from
Apr 29, 2023

Conversation

notriddle
Copy link
Contributor

Before

image

After

image

Description

In the old setup, if the dereffed-to item has multiple impl blocks, each one gets its own div.impl-items in the section, but there are no headers separating them. Since the last method in a div.impl-items has no bottom margin, and there are no margins between these divs, there is no margin between the last method of one impl and the first method of the following impl.

This patch fixes it by simplifying the HTML. Each Deref block gets exactly one div.impl-items, no matter how many impl blocks it actually has.

In the old setup, if the dereffed-to item has multiple impl blocks,
each one gets its own `div.impl-items` in the section, but there
are no headers separating them. Since the last method in a
`div.impl-items` has no bottom margin, and there are no margins
between these divs, there is no margin between the last method
of one impl and the first method of the following impl.

This patch fixes it by simplifying the HTML. Each Deref block gets
exactly one `div.impl-items`, no matter how many impl blocks it
actually has.
@rustbot
Copy link
Collaborator

rustbot commented Apr 28, 2023

r? @GuillaumeGomez

(rustbot has picked a reviewer for you, use r? to override)

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Apr 28, 2023
@GuillaumeGomez
Copy link
Member

This is super cool, thanks!

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Apr 29, 2023

📌 Commit 2299ba1 has been approved by GuillaumeGomez

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 29, 2023
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Apr 29, 2023
…GuillaumeGomez

rustdoc: fix weird margins between Deref impl items

## Before

![image](https://user-images.githubusercontent.com/1593513/235245977-90770591-22c1-4a27-9464-248a3729a2b7.png)

## After

![image](https://user-images.githubusercontent.com/1593513/235246009-0e83113e-42b7-4e29-981d-969f9d20af01.png)

## Description

In the old setup, if the dereffed-to item has multiple impl blocks, each one gets its own `div.impl-items` in the section, but there are no headers separating them. Since the last method in a `div.impl-items` has no bottom margin, and there are no margins between these divs, there is no margin between the last method of one impl and the first method of the following impl.

This patch fixes it by simplifying the HTML. Each Deref block gets exactly one `div.impl-items`, no matter how many impl blocks it actually has.
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Apr 29, 2023
…GuillaumeGomez

rustdoc: fix weird margins between Deref impl items

## Before

![image](https://user-images.githubusercontent.com/1593513/235245977-90770591-22c1-4a27-9464-248a3729a2b7.png)

## After

![image](https://user-images.githubusercontent.com/1593513/235246009-0e83113e-42b7-4e29-981d-969f9d20af01.png)

## Description

In the old setup, if the dereffed-to item has multiple impl blocks, each one gets its own `div.impl-items` in the section, but there are no headers separating them. Since the last method in a `div.impl-items` has no bottom margin, and there are no margins between these divs, there is no margin between the last method of one impl and the first method of the following impl.

This patch fixes it by simplifying the HTML. Each Deref block gets exactly one `div.impl-items`, no matter how many impl blocks it actually has.
bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 29, 2023
…iaskrgr

Rollup of 6 pull requests

Successful merges:

 - rust-lang#105848 (rustdoc: Add a new lint for broken inline code)
 - rust-lang#110644 (Update tests for libtest `--format json`)
 - rust-lang#110950 (Deny the `unsafe_op_in_unsafe_fn` lint in `rustc_arena`.)
 - rust-lang#110951 (Add support for LibreSSL 3.7.x)
 - rust-lang#110964 (rustdoc: fix weird margins between Deref impl items)
 - rust-lang#110979 (windows: kill rust-analyzer-proc-macro-srv before deleting stage0 directory)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 39ed894 into rust-lang:master Apr 29, 2023
@rustbot rustbot added this to the 1.71.0 milestone Apr 29, 2023
@notriddle notriddle deleted the notriddle/deref-impl branch April 29, 2023 19:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants